16 #ifndef __Ice_Instrumentation_h__
17 #define __Ice_Instrumentation_h__
34 #ifndef ICE_IGNORE_VERSION
35 # if ICE_INT_VERSION / 100 != 307
36 # error Ice version mismatch!
38 # if ICE_INT_VERSION % 100 >= 50
39 # error Beta header file detected
41 # if ICE_INT_VERSION % 100 < 10
42 # error Ice patch level mismatch!
47 # if defined(ICE_STATIC_LIBS)
49 # elif defined(ICE_API_EXPORTS)
50 # define ICE_API ICE_DECLSPEC_EXPORT
52 # define ICE_API ICE_DECLSPEC_IMPORT
56 #ifdef ICE_CPP11_MAPPING // C++11 mapping
62 namespace Instrumentation
83 namespace Instrumentation
101 ThreadStateInUseForIO,
107 ThreadStateInUseForUser,
123 ConnectionStateValidating,
127 ConnectionStateHolding,
131 ConnectionStateActive,
136 ConnectionStateClosing,
151 namespace Instrumentation
181 virtual void failed(const ::std::string& exceptionName) = 0;
322 virtual ::std::shared_ptr<::Ice::Instrumentation::RemoteObserver>
getRemoteObserver(const ::std::shared_ptr<::Ice::ConnectionInfo>& con, const ::std::shared_ptr<::Ice::Endpoint>& endpt,
int requestId,
int size) = 0;
331 virtual ::std::shared_ptr<::Ice::Instrumentation::CollocatedObserver>
getCollocatedObserver(const ::std::shared_ptr<::Ice::ObjectAdapter>& adapter,
int requestId,
int size) = 0;
413 virtual ::std::shared_ptr<::Ice::Instrumentation::Observer>
getEndpointLookupObserver(const ::std::shared_ptr<::Ice::Endpoint>& endpt) = 0;
427 virtual ::std::shared_ptr<::Ice::Instrumentation::ConnectionObserver>
getConnectionObserver(const ::std::shared_ptr<::Ice::ConnectionInfo>& c, const ::std::shared_ptr<::Ice::Endpoint>& e,
ConnectionState s, const ::std::shared_ptr<ConnectionObserver>& o) = 0;
441 virtual ::std::shared_ptr<::Ice::Instrumentation::ThreadObserver>
getThreadObserver(const ::std::string& parent, const ::std::string&
id,
ThreadState s, const ::std::shared_ptr<ThreadObserver>& o) = 0;
464 virtual ::std::shared_ptr<::Ice::Instrumentation::DispatchObserver>
getDispatchObserver(const ::Ice::Current& c,
int size) = 0;
492 namespace Instrumentation
495 using ObserverPtr = ::std::shared_ptr<Observer>;
497 using ThreadObserverPtr = ::std::shared_ptr<ThreadObserver>;
499 using ConnectionObserverPtr = ::std::shared_ptr<ConnectionObserver>;
501 using DispatchObserverPtr = ::std::shared_ptr<DispatchObserver>;
503 using ChildInvocationObserverPtr = ::std::shared_ptr<ChildInvocationObserver>;
505 using RemoteObserverPtr = ::std::shared_ptr<RemoteObserver>;
507 using CollocatedObserverPtr = ::std::shared_ptr<CollocatedObserver>;
509 using InvocationObserverPtr = ::std::shared_ptr<InvocationObserver>;
511 using ObserverUpdaterPtr = ::std::shared_ptr<ObserverUpdater>;
513 using CommunicatorObserverPtr = ::std::shared_ptr<CommunicatorObserver>;
521 #else // C++98 mapping
526 namespace Instrumentation
531 ICE_API ::Ice::LocalObject*
upCast(Observer*);
533 typedef ::IceInternal::Handle< Observer> ObserverPtr;
535 class ThreadObserver;
537 ICE_API ::Ice::LocalObject*
upCast(ThreadObserver*);
539 typedef ::IceInternal::Handle< ThreadObserver> ThreadObserverPtr;
541 class ConnectionObserver;
543 ICE_API ::Ice::LocalObject*
upCast(ConnectionObserver*);
545 typedef ::IceInternal::Handle< ConnectionObserver> ConnectionObserverPtr;
547 class DispatchObserver;
549 ICE_API ::Ice::LocalObject*
upCast(DispatchObserver*);
551 typedef ::IceInternal::Handle< DispatchObserver> DispatchObserverPtr;
553 class ChildInvocationObserver;
555 ICE_API ::Ice::LocalObject*
upCast(ChildInvocationObserver*);
557 typedef ::IceInternal::Handle< ChildInvocationObserver> ChildInvocationObserverPtr;
559 class RemoteObserver;
561 ICE_API ::Ice::LocalObject*
upCast(RemoteObserver*);
563 typedef ::IceInternal::Handle< RemoteObserver> RemoteObserverPtr;
565 class CollocatedObserver;
567 ICE_API ::Ice::LocalObject*
upCast(CollocatedObserver*);
569 typedef ::IceInternal::Handle< CollocatedObserver> CollocatedObserverPtr;
571 class InvocationObserver;
573 ICE_API ::Ice::LocalObject*
upCast(InvocationObserver*);
575 typedef ::IceInternal::Handle< InvocationObserver> InvocationObserverPtr;
577 class ObserverUpdater;
579 ICE_API ::Ice::LocalObject*
upCast(ObserverUpdater*);
581 typedef ::IceInternal::Handle< ObserverUpdater> ObserverUpdaterPtr;
583 class CommunicatorObserver;
585 ICE_API ::Ice::LocalObject*
upCast(CommunicatorObserver*);
587 typedef ::IceInternal::Handle< CommunicatorObserver> CommunicatorObserverPtr;
596 namespace Instrumentation
614 ThreadStateInUseForIO,
620 ThreadStateInUseForUser,
636 ConnectionStateValidating,
640 ConnectionStateHolding,
644 ConnectionStateActive,
649 ConnectionStateClosing,
664 namespace Instrumentation
672 class ICE_API Observer :
public virtual ::Ice::LocalObject
676 typedef ObserverPtr PointerType;
680 #ifdef ICE_CPP11_COMPILER
681 Observer() =
default;
682 Observer(
const Observer&) =
default;
683 Observer& operator=(
const Observer&) =
default;
690 virtual void attach() = 0;
696 virtual void detach() = 0;
702 virtual void failed(const ::std::string& exceptionName) = 0;
706 inline bool operator==(
const Observer& lhs,
const Observer& rhs)
708 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
711 inline bool operator<(
const Observer& lhs,
const Observer& rhs)
713 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);
723 class ICE_API ThreadObserver :
virtual public Observer
727 typedef ThreadObserverPtr PointerType;
729 virtual ~ThreadObserver();
731 #ifdef ICE_CPP11_COMPILER
732 ThreadObserver() =
default;
733 ThreadObserver(
const ThreadObserver&) =
default;
734 ThreadObserver& operator=(
const ThreadObserver&) =
default;
746 inline bool operator==(
const ThreadObserver& lhs,
const ThreadObserver& rhs)
748 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
751 inline bool operator<(
const ThreadObserver& lhs,
const ThreadObserver& rhs)
753 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);
761 class ICE_API ConnectionObserver :
virtual public Observer
765 typedef ConnectionObserverPtr PointerType;
767 virtual ~ConnectionObserver();
769 #ifdef ICE_CPP11_COMPILER
770 ConnectionObserver() =
default;
771 ConnectionObserver(
const ConnectionObserver&) =
default;
772 ConnectionObserver& operator=(
const ConnectionObserver&) =
default;
779 virtual void sentBytes(::
Ice::Int num) = 0;
785 virtual void receivedBytes(::
Ice::Int num) = 0;
789 inline bool operator==(
const ConnectionObserver& lhs,
const ConnectionObserver& rhs)
791 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
794 inline bool operator<(
const ConnectionObserver& lhs,
const ConnectionObserver& rhs)
796 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);
804 class ICE_API DispatchObserver :
virtual public Observer
808 typedef DispatchObserverPtr PointerType;
810 virtual ~DispatchObserver();
812 #ifdef ICE_CPP11_COMPILER
813 DispatchObserver() =
default;
814 DispatchObserver(
const DispatchObserver&) =
default;
815 DispatchObserver& operator=(
const DispatchObserver&) =
default;
821 virtual void userException() = 0;
827 virtual void reply(::
Ice::Int size) = 0;
831 inline bool operator==(
const DispatchObserver& lhs,
const DispatchObserver& rhs)
833 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
836 inline bool operator<(
const DispatchObserver& lhs,
const DispatchObserver& rhs)
838 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);
847 class ICE_API ChildInvocationObserver :
virtual public Observer
851 typedef ChildInvocationObserverPtr PointerType;
853 virtual ~ChildInvocationObserver();
855 #ifdef ICE_CPP11_COMPILER
856 ChildInvocationObserver() =
default;
857 ChildInvocationObserver(
const ChildInvocationObserver&) =
default;
858 ChildInvocationObserver& operator=(
const ChildInvocationObserver&) =
default;
865 virtual void reply(::
Ice::Int size) = 0;
869 inline bool operator==(
const ChildInvocationObserver& lhs,
const ChildInvocationObserver& rhs)
871 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
874 inline bool operator<(
const ChildInvocationObserver& lhs,
const ChildInvocationObserver& rhs)
876 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);
885 class ICE_API RemoteObserver :
virtual public ChildInvocationObserver
889 typedef RemoteObserverPtr PointerType;
891 virtual ~RemoteObserver();
893 #ifdef ICE_CPP11_COMPILER
894 RemoteObserver() =
default;
895 RemoteObserver(
const RemoteObserver&) =
default;
896 RemoteObserver& operator=(
const RemoteObserver&) =
default;
901 inline bool operator==(
const RemoteObserver& lhs,
const RemoteObserver& rhs)
903 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
906 inline bool operator<(
const RemoteObserver& lhs,
const RemoteObserver& rhs)
908 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);
917 class ICE_API CollocatedObserver :
virtual public ChildInvocationObserver
921 typedef CollocatedObserverPtr PointerType;
923 virtual ~CollocatedObserver();
925 #ifdef ICE_CPP11_COMPILER
926 CollocatedObserver() =
default;
927 CollocatedObserver(
const CollocatedObserver&) =
default;
928 CollocatedObserver& operator=(
const CollocatedObserver&) =
default;
933 inline bool operator==(
const CollocatedObserver& lhs,
const CollocatedObserver& rhs)
935 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
938 inline bool operator<(
const CollocatedObserver& lhs,
const CollocatedObserver& rhs)
940 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);
951 class ICE_API InvocationObserver :
virtual public Observer
955 typedef InvocationObserverPtr PointerType;
957 virtual ~InvocationObserver();
959 #ifdef ICE_CPP11_COMPILER
960 InvocationObserver() =
default;
961 InvocationObserver(
const InvocationObserver&) =
default;
962 InvocationObserver& operator=(
const InvocationObserver&) =
default;
968 virtual void retried() = 0;
973 virtual void userException() = 0;
983 virtual RemoteObserverPtr getRemoteObserver(const ::Ice::ConnectionInfoPtr& con, const ::Ice::EndpointPtr& endpt, ::
Ice::Int requestId, ::
Ice::Int size) = 0;
992 virtual CollocatedObserverPtr getCollocatedObserver(const ::Ice::ObjectAdapterPtr& adapter, ::
Ice::Int requestId, ::
Ice::Int size) = 0;
996 inline bool operator==(
const InvocationObserver& lhs,
const InvocationObserver& rhs)
998 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
1001 inline bool operator<(
const InvocationObserver& lhs,
const InvocationObserver& rhs)
1003 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);
1021 class ICE_API ObserverUpdater :
public virtual ::Ice::LocalObject
1025 typedef ObserverUpdaterPtr PointerType;
1027 virtual ~ObserverUpdater();
1029 #ifdef ICE_CPP11_COMPILER
1030 ObserverUpdater() =
default;
1031 ObserverUpdater(
const ObserverUpdater&) =
default;
1032 ObserverUpdater& operator=(
const ObserverUpdater&) =
default;
1044 virtual void updateConnectionObservers() = 0;
1055 virtual void updateThreadObservers() = 0;
1059 inline bool operator==(
const ObserverUpdater& lhs,
const ObserverUpdater& rhs)
1061 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
1064 inline bool operator<(
const ObserverUpdater& lhs,
const ObserverUpdater& rhs)
1066 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);
1079 class ICE_API CommunicatorObserver :
public virtual ::Ice::LocalObject
1083 typedef CommunicatorObserverPtr PointerType;
1085 virtual ~CommunicatorObserver();
1087 #ifdef ICE_CPP11_COMPILER
1088 CommunicatorObserver() =
default;
1089 CommunicatorObserver(
const CommunicatorObserver&) =
default;
1090 CommunicatorObserver& operator=(
const CommunicatorObserver&) =
default;
1102 virtual ObserverPtr getConnectionEstablishmentObserver(const ::Ice::EndpointPtr& endpt, const ::std::string& connector) = 0;
1114 virtual ObserverPtr getEndpointLookupObserver(const ::Ice::EndpointPtr& endpt) = 0;
1128 virtual ConnectionObserverPtr getConnectionObserver(const ::Ice::ConnectionInfoPtr& c, const ::Ice::EndpointPtr& e,
ConnectionState s,
const ConnectionObserverPtr& o) = 0;
1142 virtual ThreadObserverPtr getThreadObserver(const ::std::string& parent, const ::std::string&
id,
ThreadState s,
const ThreadObserverPtr& o) = 0;
1153 virtual InvocationObserverPtr getInvocationObserver(const ::Ice::ObjectPrx& prx, const ::std::string& operation,
const ::Ice::Context& ctx) = 0;
1165 virtual DispatchObserverPtr getDispatchObserver(const ::Ice::Current& c, ::
Ice::Int size) = 0;
1174 virtual void setObserverUpdater(
const ObserverUpdaterPtr& updater) = 0;
1178 inline bool operator==(
const CommunicatorObserver& lhs,
const CommunicatorObserver& rhs)
1180 return static_cast<const ::Ice::LocalObject&
>(lhs) ==
static_cast<const ::Ice::LocalObject&
>(rhs);
1183 inline bool operator<(
const CommunicatorObserver& lhs,
const CommunicatorObserver& rhs)
1185 return static_cast<const ::Ice::LocalObject&
>(lhs) <
static_cast<const ::Ice::LocalObject&
>(rhs);