Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Typed_SV_Message.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    Typed_SV_Message.h
00006  *
00007  *  $Id: Typed_SV_Message.h,v 1.1.1.4 2003/02/21 18:36:32 chad 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 #include "ace/OS.h"
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 #if defined (__ACE_INLINE__)
00092 #include "ace/Typed_SV_Message.i"
00093 #endif /* __ACE_INLINE__ */
00094 
00095 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00096 #include "ace/Typed_SV_Message.cpp"
00097 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00098 
00099 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00100 #pragma implementation ("Typed_SV_Message.cpp")
00101 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00102 
00103 #include "ace/post.h"
00104 
00105 #endif /* ACE_TYPED_SV_MESSAGE_H */

Generated on Mon Jun 16 11:21:59 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002