Typed_SV_Message.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    Typed_SV_Message.h
00006  *
00007  *  Typed_SV_Message.h,v 4.15 2005/10/28 23:55:10 ossama Exp
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //==========================================================================
00012 
00013 
00014 #ifndef ACE_TYPED_SV_MESSAGE_H
00015 #define ACE_TYPED_SV_MESSAGE_H
00016 
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "ace/ACE_export.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00026 
00027 /**
00028  * @class ACE_Typed_SV_Message
00029  *
00030  * @brief Defines the header file for the C++ wrapper for System V
00031  * message queues.
00032  */
00033 template <class T>
00034 class ACE_Typed_SV_Message
00035 {
00036 public:
00037   // = Initialization and termination methods.
00038   ACE_Typed_SV_Message (long type = 0,
00039                         int length = sizeof (T),
00040                         int max_size = sizeof (T));
00041   ACE_Typed_SV_Message (const T &data,
00042                         long type = 0,
00043                         int length = sizeof (T),
00044                         int max_size = sizeof (T));
00045   ~ACE_Typed_SV_Message (void);
00046 
00047   /// Get the type of the message.
00048   long type (void) const;
00049 
00050   /// Set the type of the message.
00051   void type (long type);
00052 
00053   /// Get the length of the message.
00054   int length (void) const;
00055 
00056   /// Set the length of the message.
00057   void length (int l);
00058 
00059   /// Get the maximum size of the message.
00060   int max_size (void) const;
00061 
00062   /// Set the maximum size of the message.
00063   void max_size (int m);
00064 
00065   /// Get a pointer to the data in the message.
00066   T &data (void);
00067 
00068   /// Set a pointer to the data in the message.
00069   void data (const T &data);
00070 
00071   /// Dump the state of an object.
00072   void dump (void) const;
00073 
00074   /// Declare the dynamic allocation hooks.
00075   ACE_ALLOC_HOOK_DECLARE;
00076 
00077 private:
00078   /// Type of message.
00079   long type_;
00080 
00081   /// Length of this message.
00082   int length_;
00083 
00084   /// Maximum length of any message.
00085   int max_;
00086 
00087   /// Data stored in a message.
00088   T data_;
00089 };
00090 
00091 ACE_END_VERSIONED_NAMESPACE_DECL
00092 
00093 #if defined (__ACE_INLINE__)
00094 #include "ace/Typed_SV_Message.inl"
00095 #endif /* __ACE_INLINE__ */
00096 
00097 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00098 #include "ace/Typed_SV_Message.cpp"
00099 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00100 
00101 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00102 #pragma implementation ("Typed_SV_Message.cpp")
00103 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00104 
00105 #include /**/ "ace/post.h"
00106 
00107 #endif /* ACE_TYPED_SV_MESSAGE_H */

Generated on Thu Nov 9 09:42:08 2006 for ACE by doxygen 1.3.6