PoolSynchStrategy.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef OPENDDS_DCPS_POOLSYNCHSTRATEGY_H
00009 #define OPENDDS_DCPS_POOLSYNCHSTRATEGY_H
00010 
00011 #include "dds/DCPS/dcps_export.h"
00012 #include "ThreadSynchStrategy.h"
00013 #include "ace/Task.h"
00014 #include "ace/Synch.h"
00015 #include "ace/Condition_T.h"
00016 
00017 namespace OpenDDS {
00018 namespace DCPS {
00019 
00020 class OpenDDS_Dcps_Export PoolSynchStrategy : public ACE_Task_Base,
00021       public ThreadSynchStrategy {
00022 public:
00023 
00024   PoolSynchStrategy();
00025   virtual ~PoolSynchStrategy();
00026 
00027   virtual ThreadSynch* create_synch_object(
00028     ThreadSynchResource* synch_resource,
00029     long                 priority,
00030     int                  scheduler);
00031 
00032   virtual int open(void*);
00033   virtual int svc();
00034   virtual int close(u_long);
00035 
00036   void operator delete (void* ptr) { ThreadSynchStrategy::operator delete(ptr); }
00037 private:
00038 
00039   typedef ACE_SYNCH_MUTEX         LockType;
00040   typedef ACE_Guard<LockType>     GuardType;
00041   typedef ACE_Condition<LockType> ConditionType;
00042 
00043   LockType      lock_;
00044   ConditionType condition_;
00045 };
00046 
00047 } // namespace DCPS
00048 } // namespace OpenDDS
00049 
00050 #if defined (__ACE_INLINE__)
00051 #include "PoolSynchStrategy.inl"
00052 #endif /* __ACE_INLINE__ */
00053 
00054 #endif  /* OPENDDS_DCPS_POOLSYNCHSTRATEGY_H */

Generated on Fri Feb 12 20:05:24 2016 for OpenDDS by  doxygen 1.4.7