ATM_QoS.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    ATM_QoS.h
00006  *
00007  *  ATM_QoS.h,v 4.15 2005/10/28 16:14:51 ossama Exp
00008  *
00009  *  @author Joe Hoffert
00010  */
00011 //==========================================================================
00012 
00013 
00014 #ifndef ACE_ATM_QoS_H
00015 #define ACE_ATM_QoS_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "ace/config-all.h"
00019 
00020 #if !defined(ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #if defined (ACE_HAS_ATM)
00025 
00026 #if defined (ACE_HAS_FORE_ATM_WS2)
00027 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00028 // just map to WS2 GQOS struct
00029 typedef ACE_QoS ATM_QoS;
00030 ACE_END_VERSIONED_NAMESPACE_DECL
00031 #elif defined (ACE_HAS_FORE_ATM_XTI)
00032 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00033 typedef struct netbuf ATM_QoS;
00034 ACE_END_VERSIONED_NAMESPACE_DECL
00035 #elif defined (ACE_HAS_LINUX_ATM)
00036 #include /**/ "atm.h"
00037 #include "ace/ATM_Params.h"
00038 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00039 typedef struct atm_qos ATM_QoS;
00040 ACE_END_VERSIONED_NAMESPACE_DECL
00041 #else
00042 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00043 typedef int ATM_QoS;
00044 ACE_END_VERSIONED_NAMESPACE_DECL
00045 #endif /* ACE_HAS_FORE_ATM_WS2 || ACE_HAS_FORE_ATM_XTI || ACE_HAS_LINUX_ATM */
00046 
00047 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00048 
00049 /**
00050  * @class ACE_ATM_QoS
00051  *
00052  * @brief Define the QoS parameters for ATM
00053  *
00054  * This class wraps up QoS parameters for both ATM/XTI and
00055  * ATM/WinSock2 to make the mechanism for the ATM protocol
00056  * transparent.
00057  */
00058 class ACE_Export ACE_ATM_QoS
00059 {
00060 public:
00061   // Constants used for ATM options
00062   static const long LINE_RATE;
00063   static const int OPT_FLAGS_CPID;
00064   static const int OPT_FLAGS_PMP;
00065   static const int DEFAULT_SELECTOR;
00066   static const int DEFAULT_PKT_SIZE;
00067 
00068   // = Initializattion and termination methods.
00069   /// Default constructor.
00070   ACE_ATM_QoS(int = DEFAULT_PKT_SIZE);
00071 
00072   /// Constructor with a CBR rate.
00073   ACE_ATM_QoS(int,
00074               int = DEFAULT_PKT_SIZE);
00075 
00076   ~ACE_ATM_QoS ();
00077 
00078   /// Set the rate.
00079   void set_rate (ACE_HANDLE,
00080                  int,
00081                  int);
00082 
00083   /// Set CBR rate in cells per second.
00084   void set_cbr_rate (int,
00085                      int = DEFAULT_PKT_SIZE);
00086 
00087   /// Get ATM_QoS struct.
00088   ATM_QoS get_qos (void);
00089 
00090   /// Dump the state of an object.
00091   void dump (void) const;
00092 
00093   /// Declare the dynamic allocation hooks.
00094   ACE_ALLOC_HOOK_DECLARE;
00095 
00096 protected:
00097   /// Construct QoS options.
00098   char* construct_options(ACE_HANDLE,
00099                           int,
00100                           int,
00101                           long*);
00102 
00103 private:
00104   ATM_QoS qos_;
00105 };
00106 
00107 ACE_END_VERSIONED_NAMESPACE_DECL
00108 
00109 #if defined (__ACE_INLINE__)
00110 #include "ace/ATM_QoS.inl"
00111 #endif /* __ACE_INLINE__ */
00112 
00113 #endif /* ACE_HAS_ATM */
00114 #include /**/ "ace/post.h"
00115 #endif /* ACE_ATM_QoS_H */

Generated on Thu Nov 9 09:41:46 2006 for ACE by doxygen 1.3.6