TAO_Reverse_FlowSpec_Entry Class Reference

#include <FlowSpec_Entry.h>

Inheritance diagram for TAO_Reverse_FlowSpec_Entry:

Inheritance graph
[legend]
Collaboration diagram for TAO_Reverse_FlowSpec_Entry:

Collaboration graph
[legend]
List of all members.

Public Types

 TAO_AV_FLOWNAME = 0
 TAO_AV_ADDRESS = 1
 TAO_AV_FLOW_PROTOCOL = 2
 TAO_AV_DIRECTION = 3
 TAO_AV_FORMAT = 4
enum  Position {
  TAO_AV_FLOWNAME = 0, TAO_AV_ADDRESS = 1, TAO_AV_FLOW_PROTOCOL = 2, TAO_AV_DIRECTION = 3,
  TAO_AV_FORMAT = 4
}

Public Member Functions

 TAO_Reverse_FlowSpec_Entry (void)
 TAO_Reverse_FlowSpec_Entry (const char *flowname, const char *direction, const char *format_name, const char *flow_protocol, const char *carrier_protocol, ACE_Addr *address, ACE_Addr *control_address=0)
 TAO_Reverse_FlowSpec_Entry (const char *flowname, const char *direction, const char *format_name, const char *flow_protocol, const char *address)
virtual ~TAO_Reverse_FlowSpec_Entry (void)
virtual const char * entry_to_string (void)
 converts the entry to a string.
virtual Role role (void)
virtual int parse (const char *flowSpec_entry)
 construct the entry from a string specified by the flowSpec grammar.

Detailed Description

Definition at line 310 of file FlowSpec_Entry.h.


Member Enumeration Documentation

enum TAO_Reverse_FlowSpec_Entry::Position

Enumerator:
TAO_AV_FLOWNAME 
TAO_AV_ADDRESS 
TAO_AV_FLOW_PROTOCOL 
TAO_AV_DIRECTION 
TAO_AV_FORMAT 

Definition at line 314 of file FlowSpec_Entry.h.

00314                 {TAO_AV_FLOWNAME = 0,
00315                  TAO_AV_ADDRESS = 1,
00316                  TAO_AV_FLOW_PROTOCOL = 2,
00317                  TAO_AV_DIRECTION = 3,
00318                  TAO_AV_FORMAT = 4};


Constructor & Destructor Documentation

TAO_Reverse_FlowSpec_Entry::TAO_Reverse_FlowSpec_Entry ( void   ) 

Definition at line 828 of file FlowSpec_Entry.cpp.

00829 {
00830   // no-op
00831 }

TAO_Reverse_FlowSpec_Entry::TAO_Reverse_FlowSpec_Entry ( const char *  flowname,
const char *  direction,
const char *  format_name,
const char *  flow_protocol,
const char *  carrier_protocol,
ACE_Addr address,
ACE_Addr control_address = 0 
)

Definition at line 834 of file FlowSpec_Entry.cpp.

00841   :TAO_FlowSpec_Entry (flowname,
00842                        direction,
00843                        format_name,
00844                        flow_protocol,
00845                        carrier_protocol,
00846                        address,
00847                        control_address)
00848 {
00849   // no-op
00850 }

TAO_Reverse_FlowSpec_Entry::TAO_Reverse_FlowSpec_Entry ( const char *  flowname,
const char *  direction,
const char *  format_name,
const char *  flow_protocol,
const char *  address 
)

Definition at line 853 of file FlowSpec_Entry.cpp.

00858   :TAO_FlowSpec_Entry (flowname,
00859                        direction,
00860                        format_name,
00861                        flow_protocol,
00862                        address)
00863 {
00864   // no-op.
00865 }

TAO_Reverse_FlowSpec_Entry::~TAO_Reverse_FlowSpec_Entry ( void   )  [virtual]

Definition at line 867 of file FlowSpec_Entry.cpp.

00868 {
00869   // no-op.
00870 }


Member Function Documentation

const char * TAO_Reverse_FlowSpec_Entry::entry_to_string ( void   )  [virtual]

converts the entry to a string.

Implements TAO_FlowSpec_Entry.

Definition at line 920 of file FlowSpec_Entry.cpp.

References TAO_FlowSpec_Entry::address(), TAO_FlowSpec_Entry::address_, TAO_FlowSpec_Entry::address_str(), TAO_FlowSpec_Entry::carrier_protocol_, inet_addr(), TAO_FlowSpec_Entry::local_sec_addr_, TAO_FlowSpec_Entry::num_local_sec_addrs_, TAO_AV_Core::TAO_AV_QOS_UDP, TAO_AV_Core::TAO_AV_RTP_UDP, TAO_AV_Core::TAO_AV_RTP_UDP_MCAST, TAO_AV_Core::TAO_AV_SCTP_SEQ, TAO_AV_Core::TAO_AV_SFP_UDP, TAO_AV_Core::TAO_AV_SFP_UDP_MCAST, TAO_AV_Core::TAO_AV_TCP, TAO_AV_Core::TAO_AV_UDP, TAO_AV_Core::TAO_AV_UDP_MCAST, TAO_AV_Core::TAO_AV_USERDEFINED_UDP, and TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST.

00921 {
00922   if (this->flowname_.length() == 0)
00923     return "";
00924 
00925   char address [BUFSIZ];
00926   ACE_CString address_str;
00927   if (this->address_ != 0)
00928     {
00929       switch (this->protocol_)
00930         {
00931         case TAO_AV_Core::TAO_AV_RTP_UDP:
00932         case TAO_AV_Core::TAO_AV_UDP:
00933         case TAO_AV_Core::TAO_AV_QOS_UDP:
00934         case TAO_AV_Core::TAO_AV_UDP_MCAST:
00935         case TAO_AV_Core::TAO_AV_TCP:
00936         case TAO_AV_Core::TAO_AV_SCTP_SEQ:
00937         case TAO_AV_Core::TAO_AV_SFP_UDP:
00938         case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
00939           {
00940             ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->address_);
00941             inet_addr->addr_to_string (address,BUFSIZ);
00942           }
00943           break;
00944         default:
00945           break;
00946         }
00947       ACE_CString cstring (address);
00948 
00949       address_str = this->carrier_protocol_;
00950       address_str += "=";
00951       address_str += cstring;
00952 
00953       if (this->protocol_ == TAO_AV_Core::TAO_AV_SCTP_SEQ)
00954         {
00955           for (int i = 0; i < this->num_local_sec_addrs_; i++)
00956             {
00957               address_str += ";";
00958               address_str += this->local_sec_addr_ [i];
00959             }
00960         }
00961 
00962     }
00963   else
00964     {
00965       address_str = "";
00966     }
00967 
00968   if (this->control_address_ != 0)
00969     {
00970       u_short control_port = 0;
00971 
00972 
00973       switch (this->protocol_)
00974         {
00975         case TAO_AV_Core::TAO_AV_SFP_UDP:
00976         case TAO_AV_Core::TAO_AV_SFP_UDP_MCAST:
00977         case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
00978         case TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST:
00979         case TAO_AV_Core::TAO_AV_RTP_UDP:
00980         case TAO_AV_Core::TAO_AV_RTP_UDP_MCAST:
00981         case TAO_AV_Core::TAO_AV_UDP:
00982         case TAO_AV_Core::TAO_AV_QOS_UDP:
00983         case TAO_AV_Core::TAO_AV_UDP_MCAST:
00984         case TAO_AV_Core::TAO_AV_TCP:
00985         case TAO_AV_Core::TAO_AV_SCTP_SEQ:
00986           {
00987             ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->control_address_);
00988             control_port = inet_addr->get_port_number();
00989           }
00990           break;
00991         default:
00992           break;
00993         }
00994 
00995       address_str += ";";
00996       char port_str[10];
00997       ACE_OS::sprintf(port_str, "%u", control_port);
00998       address_str += port_str;
00999 
01000     }
01001 
01002   this->entry_ = this->flowname_;
01003   this->entry_ += "\\";
01004   this->entry_ += address_str;
01005   this->entry_ += "\\";
01006   this->entry_ += this->flow_protocol_;
01007 //  this->entry_ += "\\";
01008 //  this->entry_ += this->direction_str_;
01009 //  this->entry_ += "\\";
01010 //  this->entry_ += format_;
01011 
01012   if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"Reverse entry_to_string: entry = %s\n",this->entry_.c_str() ));
01013   return this->entry_.c_str();
01014 }

int TAO_Reverse_FlowSpec_Entry::parse ( const char *  flowSpec_entry  )  [virtual]

construct the entry from a string specified by the flowSpec grammar.

Implements TAO_FlowSpec_Entry.

Definition at line 891 of file FlowSpec_Entry.cpp.

References ACE_DEBUG, TAO_FlowSpec_Entry::flowname_, LM_DEBUG, TAO_AV_ADDRESS, TAO_AV_Core::TAO_AV_BOTH, TAO_AV_FLOW_PROTOCOL, TAO_AV_FLOWNAME, and TAO_debug_level.

00892 {
00893   TAO_Tokenizer tokenizer (flowSpec_entry,'\\');
00894   this->flowname_ = tokenizer [TAO_AV_FLOWNAME];
00895 
00896   if (TAO_debug_level > 0)
00897     ACE_DEBUG ((LM_DEBUG,
00898                 "TAO_Reverse_FlowSpec_Entry::parse [%s]\n",
00899                 flowSpec_entry));
00900 
00901   if (tokenizer [TAO_AV_ADDRESS] != 0)
00902     if (this->parse_address (tokenizer [TAO_AV_ADDRESS], TAO_AV_Core::TAO_AV_BOTH) < 0)
00903       return -1;
00904 
00905   if (tokenizer [TAO_AV_FLOW_PROTOCOL] != 0)
00906     if (this->parse_flow_protocol_string (tokenizer [TAO_AV_FLOW_PROTOCOL]) < 0)
00907       return -1;
00908 
00909 //  if (tokenizer [TAO_AV_DIRECTION] != 0)
00910 //    this->set_direction (tokenizer [TAO_AV_DIRECTION]);
00911 
00912 //  if (tokenizer [TAO_AV_FORMAT] != 0)
00913 //    this->format_ = tokenizer [TAO_AV_FORMAT];
00914 
00915   return 0;
00916 }

TAO_FlowSpec_Entry::Role TAO_Reverse_FlowSpec_Entry::role ( void   )  [virtual]

Implements TAO_FlowSpec_Entry.

Definition at line 873 of file FlowSpec_Entry.cpp.

References TAO_FlowSpec_Entry::role_, TAO_FlowSpec_Entry::TAO_AV_CONSUMER, TAO_FlowSpec_Entry::TAO_AV_DIR_IN, TAO_FlowSpec_Entry::TAO_AV_DIR_OUT, TAO_FlowSpec_Entry::TAO_AV_INVALID_ROLE, and TAO_FlowSpec_Entry::TAO_AV_PRODUCER.

00874 {
00875   if (this->role_ != TAO_AV_INVALID_ROLE)
00876     return this->role_;
00877   switch (this->direction_)
00878     {
00879     case TAO_AV_DIR_IN:
00880       // Forward IN means we're the Source.
00881       return TAO_AV_CONSUMER;
00882     case TAO_AV_DIR_OUT:
00883       // Forward out means we're the sink.
00884       return TAO_AV_PRODUCER;
00885     default:
00886       return TAO_AV_INVALID_ROLE;
00887     }
00888 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:48:10 2010 for TAO_AV by  doxygen 1.4.7