Current_Impl.h

Go to the documentation of this file.
00001 // $Id: Current_Impl.h 76995 2007-02-11 12:51:42Z johnnyw $
00002 
00003 #ifndef CURRENT_IMPL_H
00004 #define CURRENT_IMPL_H
00005 
00006 #include /**/ "ace/pre.h"
00007 
00008 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00009 # pragma once
00010 #endif /* ACE_LACKS_PRAGMA_ONCE */
00011 
00012 #if TAO_HAS_TRANSPORT_CURRENT == 1
00013 
00014 #include "tao/TransportCurrent/TCC.h"
00015 #include "tao/LocalObject.h"
00016 
00017 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00018 
00019 class TAO_Transport;
00020 
00021 namespace TAO
00022 {
00023   namespace Transport
00024   {
00025 
00026     // Forward decl
00027     class Stats;
00028 
00029     /**
00030      * @class Current_impl
00031      *
00032      * @brief Implementation of the TAO::Transport::Current
00033      * interface.
00034      *
00035      * Current_Impl is useful for obtaining information about the
00036      * Transport, associated with the calling thread.
00037      */
00038     class TAO_Transport_Current_Export Current_Impl
00039       : public virtual Current
00040       , public virtual TAO_Local_RefCounted_Object
00041       {
00042       public:
00043 
00044         /// Constructor.
00045         Current_Impl (TAO_ORB_Core* core, size_t tss_slot_id);
00046 
00047         /**
00048          * These are methods exposed by the
00049          * PortableInterceptor::Current interface.
00050          */
00051         //@{
00052         virtual CORBA::Long id (void);
00053 
00054         virtual CounterT bytes_sent (void);
00055 
00056         virtual CounterT bytes_received (void);
00057 
00058         virtual CounterT messages_sent (void);
00059 
00060         virtual CounterT messages_received (void);
00061 
00062         virtual ::TimeBase::TimeT open_since (void);
00063         //@}
00064 
00065       protected:
00066 
00067         /**
00068          * Some helper methods
00069          */
00070         //@{
00071         /// A (strategy) method used to obtain the transport ptr
00072         const TAO_Transport* transport (void) const;
00073 
00074         /// A Stats instance. If protocol is unavailable (0) or the
00075         /// TAO_HAS_TRANSPORT_CURRENT macro is defined as anything but
00076         /// 1, a single static instance will be used.
00077         const TAO::Transport::Stats* transport_stats (void) const;
00078         //@}
00079 
00080         /// Destructor is protected to enforce the fact this class is
00081         /// reference counted, and should not be destroyed using
00082         /// delete() by anything other than the reference counting
00083         /// mechanism.
00084         virtual ~Current_Impl (void);
00085 
00086       private:
00087 
00088         /// Prevent copying through the copy constructor and the
00089         /// assignment operator.
00090         //@{
00091         Current_Impl (const Current_Impl &);
00092         void operator= (const Current_Impl &);
00093         //@}
00094 
00095       private:
00096 
00097         // The ORB (core) that owes us.
00098         TAO_ORB_Core* core_;
00099 
00100         // The ORB's TSS slot id for the Transport ptr
00101         size_t tss_slot_id_;
00102       };
00103 
00104   }
00105 
00106 }
00107 
00108 TAO_END_VERSIONED_NAMESPACE_DECL
00109 
00110 #endif /* TAO_HAS_TRANSPORT_CURRENT == 1 */
00111 
00112 
00113 #include /**/ "ace/post.h"
00114 
00115 #endif /* CURRENT_IMPL_H */

Generated on Sun Jan 27 13:32:20 2008 for TAO_TransportCurrent by doxygen 1.3.6