Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

/home/pauldt/projects/IDEA/IDEA-ALL/IDEA-DEV/Modules/IPC/MetaTimingService/Includes/IPCCommunicationRelay.hh

Go to the documentation of this file.
00001 // -*- Mode: c++ -*-
00002 //      CVS: $Id: IPCCommunicationRelay.hh,v 1.5 2005/12/30 22:37:18 rijsman Exp $
00003 //      Tag: $name$
00004 //     Info: $CVSROOT/IDEA-DEV/COPYRIGHT
00005 
00006 #ifndef IPC_COMMUNICATION_RELAY_HEADER
00007 #define IPC_COMMUNICATION_RELAY_HEADER
00008 
00009 #include "Singleton.hh"
00010 #include "MetaCommunicationRelay.hh"
00011 #include "ThreadTools.hh"
00012 
00013 namespace IDEA
00014 {
00018   typedef struct
00019   {
00020     int warpAtSeconds;
00021     int warpAtNanoSeconds;
00022     int warpToSeconds;
00023     int warpToNanoSeconds;
00024     const char* timeScale;
00025   } WarpStructure;
00026 
00027 
00028 #define warpMsg_IPC "WarpMsg" 
00029 #define warpFmt_IPC "{int,int,int,int,string}"
00030 
00031 #define syncMsg_IPC "SyncMsg" 
00032 #define syncFmt_IPC "{int,int,int,int,string}"
00033 
00034   typedef struct
00035   {
00036     const char* name;
00037   } RegisterStructure;
00038 
00039 #define registerMsg_IPC "RegisterMsg" 
00040 #define registerFmt_IPC "{string}"
00041 
00053   class IPCCommunicationRelayListener:
00054     public Singleton< IPCCommunicationRelayListener >,
00055     public ACE_Task_Base
00056   {
00057     friend class Singleton< IPCCommunicationRelayListener >;
00058   public:
00062     ~IPCCommunicationRelayListener();
00068     int activate(long flags=THR_NEW_LWP|THR_JOINABLE|THR_INHERIT_SCHED, int n_threads=1, int force_active=0, long priority=ACE_DEFAULT_THREAD_PRIORITY, int grp_id=-1, ACE_Task_Base *task=0, ACE_hthread_t thread_handles[]=0, void *stack[]=0, size_t stack_size[]=0, ACE_thread_t thread_ids[]=0); 
00069 
00073     void shutDown();
00074 
00078     bool isActive() const { return m_Active; }
00079 
00084     int getListenMilliSeconds() const { return m_ListenMilliSeconds; }
00085   private:
00089     IPCCommunicationRelayListener( int listenMilliSeconds = 100 );
00093     int svc( void );
00094 
00095     int m_ListenMilliSeconds;
00096     bool m_Active;
00097   };
00098 
00099   class SharedTimingService;
00105   class IPCCommunicationRelay:
00106     public MetaCommunicationRelay
00107   {
00108   public:
00112     IPCCommunicationRelay( const std::string& name = "IPCCommunicationRelay" );
00116     ~IPCCommunicationRelay();
00120     void synchronize( const Time& pivot, int timescale ) const;
00124     void warp( const Time& at, const Time& warpTo, double timescale ) const;
00125   private:
00129     void activateExtended();
00133     void connect() const;
00137     void defineMessages() const;
00141     void subscribeMessages();
00142 
00143     bool m_Active;
00144   };
00145 
00146 }
00147 
00148 #endif // IPC_COMMUNICATION_RELAY_HEADER
00149   

Contact information
© IDEA
Generated on Fri Feb 3 17:09:42 2006 for IDEA.