Fill_ACE_QoS.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Fill_ACE_QoS.h
00006  *
00007  *  $Id: Fill_ACE_QoS.h 69284 2005-11-10 06:47:24Z ossama $
00008  *
00009  *  @author Vishal Kachroo <vishal@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef FILL_ACE_QOS_H
00015 #define FILL_ACE_QOS_H
00016 
00017 #include "ace/config-all.h"
00018 
00019 #if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
00020 
00021 #include "tao/Versioned_Namespace.h"
00022 
00023 #include "ace/SString.h"
00024 #include "ace/Hash_Map_Manager_T.h"
00025 #include "ace/Synch.h"
00026 #include "ace/ACE.h"
00027 #include "ace/OS_QoS.h"
00028 
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 /**
00032  * @class Fill_ACE_QoS
00033  * 
00034  * This class helps users to add new flow specs and provides
00035  * utility functions for filling up the flow specs for simplex/duplex
00036  * sessions.
00037  */
00038 class Fill_ACE_QoS
00039 {
00040 
00041 public:
00042   typedef ACE_Hash_Map_Manager <ACE_CString, ACE_Flow_Spec *, ACE_Null_Mutex> FLOW_SPEC_HASH_MAP;
00043 
00044   //Initialization and termination methods.
00045   /// constructor.
00046   Fill_ACE_QoS (void);
00047 
00048   /// destructor.
00049   ~Fill_ACE_QoS (void);
00050 
00051   /// To be used by receivers. Fills the receiver qos and sets the
00052   /// sender qos to NO_TRAFFIC.
00053   int fill_simplex_receiver_qos (ACE_QoS &ace_qos,
00054                                  ACE_Flow_Spec *recv_flow_spec);
00055 
00056   /// To be used by senders. Fills the sender qos and sets the receiver
00057   /// qos to NO_TRAFFIC.
00058   int fill_simplex_sender_qos (ACE_QoS &ace_qos,
00059                                ACE_Flow_Spec *recv_flow_spec);
00060 
00061   /// To be used by applications that wish to be both receivers and
00062   /// senders.
00063   int fill_duplex_qos (ACE_QoS &ace_qos,
00064                        ACE_Flow_Spec *recv_flow_spec,
00065                        ACE_Flow_Spec *sender_flow_spec);
00066 
00067   /// Returns the hash map of flowspecs indexed by flowspec name.
00068   FLOW_SPEC_HASH_MAP& map (void);
00069 
00070 private:
00071 
00072   // The Service Provider is currently set to NULL for all ACE_QoS.
00073   static const iovec iov_;
00074 
00075   // A NO_TRAFFIC flow spec. Senders set the receiving qos to this
00076   // while the receivers set the sending qos to this.
00077   ACE_Flow_Spec *default_traffic_;
00078 
00079   // A list of flowspecs indexed by the flowspec name.
00080   FLOW_SPEC_HASH_MAP flow_spec_map_;
00081 };
00082 
00083 TAO_END_VERSIONED_NAMESPACE_DECL
00084 
00085 #endif /* ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS */
00086 #endif /* FILL_ACE_QOS_H */

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