NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
connection_points_interface.h
Go to the documentation of this file.
1 #ifndef SDK_BASE_CONNECTION_POINTS_INTERFACE_H_
11 #define SDK_BASE_CONNECTION_POINTS_INTERFACE_H_
12 
13 #include <base/inc/sdk_results.h>
14 #include <base/inc/base_types.h>
16 #include <base/inc/sdk_ref_ptr.h>
17 
18 namespace sdk {
19 
20 FWD_DECL_INTERFACE(IConnectionPointContainer);
21 FWD_DECL_INTERFACE(IConnectionPoint);
22 FWD_DECL_INTERFACE(IConnectionsEnumerator);
23 
27 typedef SDKUInt32 ConnectionPointCookie;
32 
36 {
37 public:
39  virtual SDKResult SDK_CALLTYPE GetConnectionPointsCount(
40  SDKUInt32& count) const throw() = 0;
42  virtual SDKResult SDK_CALLTYPE GetConnectionPoint(SDKUInt32 idx,
43  IConnectionPointSP& cp) const throw() = 0;
45  virtual SDKResult SDK_CALLTYPE FindConnectionPoint(const InterfaceId& id,
46  IConnectionPointSP& cp) const throw() = 0;
47 
48  SDK_IMPLEMENT_IID(IConnectionPointContainer)
49  SDK_END_INTERFACE(IConnectionPointContainer)
50 };
51 SDK_DECLARE_IID(IConnectionPointContainer)
52 
53 class IConnectionPoint : public ISDKComponent
56 {
57 public:
59  virtual SDKResult SDK_CALLTYPE GetConnectionInterfaceId(
60  InterfaceId& id) const throw() = 0;
61 
63  virtual SDKResult SDK_CALLTYPE Advise(ISDKComponent* sink,
64  SDKUInt32& cookie) throw() = 0;
66  virtual SDKResult SDK_CALLTYPE Unadvise(SDKUInt32& cookie) throw() = 0;
67 
69  virtual SDKResult SDK_CALLTYPE GetConnections(
70  IConnectionsEnumeratorSP& enumerator) const throw() = 0;
71 
72  SDK_IMPLEMENT_IID(IConnectionPoint)
73  SDK_END_INTERFACE(IConnectionPoint)
74 };
75 SDK_DECLARE_IID(IConnectionPoint)
76 
77 class IConnectionsEnumerator : public ISDKComponent
80 {
81 public:
83  virtual SDKResult SDK_CALLTYPE Next(ISDKComponent** sink,
84  SDKUInt32* cookie) const throw() = 0;
86  virtual SDKResult SDK_CALLTYPE Reset() throw() = 0;
87 
88  SDK_IMPLEMENT_IID(IConnectionsEnumerator)
89  SDK_END_INTERFACE(IConnectionsEnumerator)
90 };
91 SDK_DECLARE_IID(IConnectionsEnumerator)
92 
93 
94 } // namespace sdk
95 
96 #endif // SDK_BASE_CONNECTION_POINTS_INTERFACE_H_
sdk_results.h
A list of SDK error/return results.
sdk::IConnectionPoint::GetConnectionInterfaceId
virtual SDKResult SDK_CALLTYPE GetConnectionInterfaceId(InterfaceId &id) const =0
Returns connection point interface identifier.
sdk::IConnectionPointContainer
Provides access to connection points implemented by component.
Definition: connection_points_interface.h:35
base_types.h
SDK base types.
sdk_ref_ptr.h
Interfaces wrapper with reference count control.
sdk::IConnectionPoint::Unadvise
virtual SDKResult SDK_CALLTYPE Unadvise(SDKUInt32 &cookie)=0
Disconnects from the connection point.
sdk::IConnectionPointContainer::FindConnectionPoint
virtual SDKResult SDK_CALLTYPE FindConnectionPoint(const InterfaceId &id, IConnectionPointSP &cp) const =0
Search for connection points with specified identifier.
sdk::IConnectionPoint::Advise
virtual SDKResult SDK_CALLTYPE Advise(ISDKComponent *sink, SDKUInt32 &cookie)=0
Connects to the connection point. Cookie starts from 0.
InterfaceId
Uuid InterfaceId
Definition of interface UUID.
Definition: sdk_uuid.h:45
sdk::IConnectionPoint::GetConnections
virtual SDKResult SDK_CALLTYPE GetConnections(IConnectionsEnumeratorSP &enumerator) const =0
Returns existing connections.
sdk::IConnectionsEnumerator::Reset
virtual SDKResult SDK_CALLTYPE Reset()=0
Resets the enumeration sequence to the beginning.
sdk::IConnectionsEnumerator::Next
virtual SDKResult SDK_CALLTYPE Next(ISDKComponent **sink, SDKUInt32 *cookie) const =0
Retrieves the next connection in the enumeration sequence.
SDKResult
SDKInt32 SDKResult
Type of all error or return codes which SDK functions can end with.
Definition: sdk_results.h:17
sdk::IConnectionPointContainer::GetConnectionPoint
virtual SDKResult SDK_CALLTYPE GetConnectionPoint(SDKUInt32 idx, IConnectionPointSP &cp) const =0
Returns specified by index connection points.
sdk_component_interface.h
Common base SDK interfaces.
sdk::ConnectionPointCookie
SDKUInt32 ConnectionPointCookie
Connection point cookie.
Definition: connection_points_interface.h:27
ISDKComponent
Base interface for all SDK interfaces.
Definition: sdk_component_interface.h:41
SDK_MAX_UINT32
static const SDKUInt32 SDK_MAX_UINT32
Max limit of 32-bit unsigned integer.
Definition: platform.h:179
sdk::IConnectionPoint
Allows to connect to the connection point and enumerate all existing connections.
Definition: connection_points_interface.h:55
sdk::IConnectionPointContainer::GetConnectionPointsCount
virtual SDKResult SDK_CALLTYPE GetConnectionPointsCount(SDKUInt32 &count) const =0
Returns number of connection points.
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.
sdk::kConnectionPointInvalidCookie
static const ConnectionPointCookie kConnectionPointInvalidCookie
Invalid connection point cookie.
Definition: connection_points_interface.h:29