Protocol_Factory.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Protocol_Factory.h
00006  *
00007  *  $Id: Protocol_Factory.h 71526 2006-03-14 06:14:35Z jtc $
00008  *
00009  *  @author Nagarajan Surendran <naga@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_AV_PROTOCOL_FACTORY_T_H
00015 #define TAO_AV_PROTOCOL_FACTORY_T_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "orbsvcs/AV/FlowSpec_Entry.h"
00019 #include "orbsvcs/AV/Policy.h"
00020 
00021 #include "ace/Service_Object.h"
00022 
00023 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00024 
00025 /**
00026  * @class TAO_AV_Protocol_Object
00027  * @brief
00028  */
00029 class TAO_AV_Export TAO_AV_Protocol_Object
00030 {
00031 public:
00032   TAO_AV_Protocol_Object (void);
00033 
00034   /// constructor.
00035   TAO_AV_Protocol_Object (TAO_AV_Callback *callback,
00036                           TAO_AV_Transport *transport);
00037 
00038   /// Destructor
00039   virtual ~TAO_AV_Protocol_Object (void);
00040 
00041   virtual int open (TAO_AV_Callback *callback,
00042                     TAO_AV_Transport *transport);
00043 
00044   virtual int handle_input (void) = 0;
00045 
00046   /// Called on a control object.
00047   virtual int handle_control_input (ACE_Message_Block *control_frame,
00048                                     const ACE_Addr &peer_address);
00049 
00050   /// set/get policies.
00051   virtual int set_policies (const TAO_AV_PolicyList &policy_list);
00052   virtual TAO_AV_PolicyList get_policies (void);
00053 
00054   /// start/stop the flow.
00055   virtual int start (void);
00056   virtual int stop (void);
00057 
00058   /// send a data frame.
00059   virtual int send_frame (ACE_Message_Block *frame,
00060                           TAO_AV_frame_info *frame_info = 0) = 0;
00061 
00062   /// send a frame in iovecs.
00063   virtual int send_frame (const iovec *iov,
00064                           int iovcnt,
00065                           TAO_AV_frame_info *frame_info = 0) = 0;
00066 
00067   virtual int send_frame (const char *buf,
00068                           size_t len) = 0;
00069 
00070   /// end the stream.
00071   virtual void control_object (TAO_AV_Protocol_Object *object);
00072   virtual int destroy (void) = 0;
00073   TAO_AV_Transport *transport (void);
00074 protected:
00075   TAO_AV_Transport *transport_;
00076   TAO_AV_PolicyList policy_list_;
00077   TAO_AV_Callback *callback_;
00078 };
00079 
00080 /**
00081  * @class TAO_AV_Flow_Protocol_Factory
00082  * @brief
00083  */
00084 class TAO_AV_Export TAO_AV_Flow_Protocol_Factory : public ACE_Service_Object
00085 {
00086 public:
00087   /// Initialization hook.
00088   TAO_AV_Flow_Protocol_Factory (void);
00089   virtual ~TAO_AV_Flow_Protocol_Factory (void);
00090   virtual int init (int argc, char *argv[]);
00091   virtual int match_protocol (const char *flow_string);
00092   virtual TAO_AV_Protocol_Object* make_protocol_object (TAO_FlowSpec_Entry *entry,
00093                                                         TAO_Base_StreamEndPoint *endpoint,
00094                                                         TAO_AV_Flow_Handler *handler,
00095                                                         TAO_AV_Transport *transport);
00096   virtual const char *control_flow_factory (void);
00097   int ref_count;
00098 };
00099 
00100 TAO_END_VERSIONED_NAMESPACE_DECL
00101 
00102 #include /**/ "ace/post.h"
00103 #endif /* TAO_AV_PROTOCOL_FACTORY_T_H */

Generated on Tue Feb 2 17:47:49 2010 for TAO_AV by  doxygen 1.4.7