Merge pull request #2218 from jwillemsen/jwi-pthreadsigmask
[ACE_TAO.git] / TAO / tao / TransportCurrent / Current_Impl.h
blob50e48f70c223c2bad32597602e7b8eb3dcb7ab99
1 #ifndef CURRENT_IMPL_H
2 #define CURRENT_IMPL_H
4 #include /**/ "ace/pre.h"
6 #if !defined (ACE_LACKS_PRAGMA_ONCE)
7 # pragma once
8 #endif /* ACE_LACKS_PRAGMA_ONCE */
10 #if TAO_HAS_TRANSPORT_CURRENT == 1
12 #include "tao/TransportCurrent/TCC.h"
13 #include "tao/LocalObject.h"
15 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
17 class TAO_Transport;
19 namespace TAO
21 namespace Transport
23 // Forward decl
24 class Stats;
26 /**
27 * @class Current_impl
29 * @brief Implementation of the TAO::Transport::Current
30 * interface.
32 * Current_Impl is useful for obtaining information about the
33 * Transport, associated with the calling thread.
35 class TAO_Transport_Current_Export Current_Impl
36 : public virtual Current
37 , public virtual ::CORBA::LocalObject
39 public:
40 /// Constructor.
41 Current_Impl (TAO_ORB_Core* core, size_t tss_slot_id);
43 /**
44 * These are methods exposed by the
45 * PortableInterceptor::Current interface.
47 //@{
48 virtual CORBA::Long id ();
50 virtual CounterT bytes_sent ();
52 virtual CounterT bytes_received ();
54 virtual CounterT messages_sent ();
56 virtual CounterT messages_received ();
58 virtual ::TimeBase::TimeT open_since ();
59 //@}
61 protected:
62 /**
63 * Some helper methods
65 //@{
66 /// A (strategy) method used to obtain the transport ptr
67 const TAO_Transport* transport () const;
69 /// A Stats instance. If protocol is unavailable (0) or the
70 /// TAO_HAS_TRANSPORT_CURRENT macro is defined as anything but
71 /// 1, a single static instance will be used.
72 const TAO::Transport::Stats* transport_stats () const;
73 //@}
75 /// Destructor is protected to enforce the fact this class is
76 /// reference counted, and should not be destroyed using
77 /// delete() by anything other than the reference counting
78 /// mechanism.
79 virtual ~Current_Impl ();
81 private:
82 Current_Impl (const Current_Impl &) = delete;
83 void operator= (const Current_Impl &) = delete;
85 private:
86 // The ORB (core) that owes us.
87 TAO_ORB_Core* core_;
89 // The ORB's TSS slot id for the Transport ptr
90 size_t tss_slot_id_;
96 TAO_END_VERSIONED_NAMESPACE_DECL
98 #endif /* TAO_HAS_TRANSPORT_CURRENT == 1 */
101 #include /**/ "ace/post.h"
103 #endif /* CURRENT_IMPL_H */