Public Member Functions | Protected Member Functions | Protected Attributes

TAO_VDev Class Reference

Implements the VDev interface. One of these is created per connection, and represents device-specific parameters. More...

#include <AVStreams_i.h>

List of all members.

Public Member Functions

 TAO_VDev (void)
 Default Constructor.
virtual CORBA::Boolean set_peer (AVStreams::StreamCtrl_ptr the_ctrl, AVStreams::VDev_ptr the_peer_dev, AVStreams::streamQoS &the_qos, const AVStreams::flowSpec &the_spec)
 Called to tell the vdev who the streamctrl, peer vdev is.
virtual CORBA::Boolean set_Mcast_peer (AVStreams::StreamCtrl_ptr the_ctrl, AVStreams::MCastConfigIf_ptr a_mcastconfigif, AVStreams::streamQoS &the_qos, const AVStreams::flowSpec &the_spec)
 Used to set the streamctrl and multicast device.
virtual void configure (const CosPropertyService::Property &the_config_mesg)
 Called by the peer VDev to configure the device (catch all).
virtual void set_format (const char *flowName, const char *format_name)
 Used to set a format on a flowname.
virtual void set_dev_params (const char *flowName, const CosPropertyService::Properties &new_params)
 Used to set device parameters.
virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &the_qos, const AVStreams::flowSpec &the_spec)
 Called to change QoS of the device.

Protected Member Functions

virtual ~TAO_VDev (void)
virtual CORBA::Boolean set_media_ctrl (CORBA::Object_ptr media_ctrl)
 hook called after set_peer is done to set the media ctrl of the peer vdev.

Protected Attributes

AVStreams::StreamCtrl_var streamctrl_
 My stream controller.
AVStreams::VDev_var peer_
 My peer.
AVStreams::MCastConfigIf_var mcast_peer_
 The multicast VDev peer.

Detailed Description

Implements the VDev interface. One of these is created per connection, and represents device-specific parameters.

Definition at line 640 of file AVStreams_i.h.


Constructor & Destructor Documentation

TAO_VDev::TAO_VDev ( void   ) 

Default Constructor.

Definition at line 2752 of file AVStreams_i.cpp.

{
  if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
              "(%P|%t) TAO_VDev::TAO_VDev: created\n"));
}

TAO_VDev::~TAO_VDev ( void   )  [protected, virtual]

Destructor for a servant should be protected or private. Use _remove_ref() to delete this servant.

Definition at line 2920 of file AVStreams_i.cpp.

{
}


Member Function Documentation

void TAO_VDev::configure ( const CosPropertyService::Property &  the_config_mesg  )  [virtual]

Called by the peer VDev to configure the device (catch all).

Definition at line 2826 of file AVStreams_i.cpp.

{
}

CORBA::Boolean TAO_VDev::modify_QoS ( AVStreams::streamQoS the_qos,
const AVStreams::flowSpec the_spec 
) [virtual]

Called to change QoS of the device.

Definition at line 2880 of file AVStreams_i.cpp.

{
  if (TAO_debug_level > 0)
  ACE_DEBUG ((LM_DEBUG,
             "TAO_VDev::modify_QoS\n"));

  if (flowspec.length () != 0)
    {
      TAO_Forward_FlowSpec_Entry entry;
      entry.parse (flowspec [0]);
      int direction = entry.direction ();
      if (direction == 0)
        {
          AVStreams::StreamEndPoint_A_ptr sep_a;

          CORBA::Any_ptr streamendpoint_a_any =
          this->get_property_value ("Related_StreamEndpoint");

          *streamendpoint_a_any >>= sep_a;
          if (sep_a != 0)
            {
              sep_a->modify_QoS (the_qos, flowspec);
            }
          else ACE_DEBUG ((LM_DEBUG,
                           "Stream EndPoint Not Found\n"));
        }
      else
        {
          AVStreams::StreamEndPoint_B_ptr sep_b;

          CORBA::Any_ptr streamendpoint_b_any =
          this->get_property_value ("Related_StreamEndpoint");
          *streamendpoint_b_any >>= sep_b;
          sep_b->modify_QoS (the_qos, flowspec);
        }
  }
  return 1;
}

void TAO_VDev::set_dev_params ( const char *  flowName,
const CosPropertyService::Properties &  new_params 
) [virtual]

Used to set device parameters.

Definition at line 2856 of file AVStreams_i.cpp.

{
  try
    {
      if (flowName == 0)
        ACE_ERROR ((LM_ERROR, "TAO_VDev::set_dev_params:flowName is null\n"));
      char devParams_property[BUFSIZ];
      ACE_OS::sprintf (devParams_property, "%s_devParams", flowName);
      CORBA::Any devParams;
      devParams <<= new_params;
      this->define_property (devParams_property,
                             devParams);
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("TAO_VDev::set_dev_params");
      return;
    }
  return;
}

void TAO_VDev::set_format ( const char *  flowName,
const char *  format_name 
) [virtual]

Used to set a format on a flowname.

Definition at line 2832 of file AVStreams_i.cpp.

{
  try
    {
      if (flowName == 0 || format_name == 0)
        ACE_ERROR ((LM_ERROR, "TAO_VDev::set_format: flowName or format_name is null\n"));
      char format_property [BUFSIZ];
      ACE_OS::sprintf (format_property, "%s_currFormat", flowName);
      CORBA::Any format;
      format <<= format_name;
      this->define_property (format_property,
                             format);
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("TAO_VDev::set_format");
      return;
    }
  return;
}

CORBA::Boolean TAO_VDev::set_Mcast_peer ( AVStreams::StreamCtrl_ptr  the_ctrl,
AVStreams::MCastConfigIf_ptr  a_mcastconfigif,
AVStreams::streamQoS the_qos,
const AVStreams::flowSpec the_spec 
) [virtual]

Used to set the streamctrl and multicast device.

Definition at line 2815 of file AVStreams_i.cpp.

{
  this->mcast_peer_ = AVStreams::MCastConfigIf::_duplicate (mcast_peer);
  return 1;
}

CORBA::Boolean TAO_VDev::set_media_ctrl ( CORBA::Object_ptr  media_ctrl  )  [protected, virtual]

hook called after set_peer is done to set the media ctrl of the peer vdev.

Definition at line 2803 of file AVStreams_i.cpp.

{
  //  since the media ctrl is not stored or used, delete it.

  CORBA::release( media_ctrl);

  return 1;
}

CORBA::Boolean TAO_VDev::set_peer ( AVStreams::StreamCtrl_ptr  the_ctrl,
AVStreams::VDev_ptr  the_peer_dev,
AVStreams::streamQoS the_qos,
const AVStreams::flowSpec the_spec 
) [virtual]

Called to tell the vdev who the streamctrl, peer vdev is.

Definition at line 2761 of file AVStreams_i.cpp.

{
  ACE_UNUSED_ARG (the_qos);
  ACE_UNUSED_ARG (the_spec);

  CORBA::Boolean result = 0;
  try
    {
      if (TAO_debug_level > 0)
        ACE_DEBUG ((LM_DEBUG, "(%P|%t) TAO_VDev::set_peer: called\n"));


      CORBA::Any anyval;
      anyval <<= the_peer_dev;
      this->define_property ("Related_VDev",
                             anyval);


      this->streamctrl_ = AVStreams::StreamCtrl::_duplicate (the_ctrl);
      this->peer_ = AVStreams::VDev::_duplicate (the_peer_dev);

      CORBA::Any_var anyptr;
      anyptr = this->peer_->get_property_value ("Related_MediaCtrl");

      CORBA::Object_ptr media_ctrl_obj = 0;

      anyptr.in () >>= CORBA::Any::to_object(media_ctrl_obj);

      result = this->set_media_ctrl (media_ctrl_obj);
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("TAO_VDev::set_peer");
      return 0;
    }
  return result;
}


Member Data Documentation

AVStreams::MCastConfigIf_var TAO_VDev::mcast_peer_ [protected]

The multicast VDev peer.

Definition at line 691 of file AVStreams_i.h.

AVStreams::VDev_var TAO_VDev::peer_ [protected]

My peer.

Definition at line 688 of file AVStreams_i.h.

AVStreams::StreamCtrl_var TAO_VDev::streamctrl_ [protected]

My stream controller.

Definition at line 685 of file AVStreams_i.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines