ADTF  3.18.2
interface_binding_object.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include "named_graph_object.h"
12 #include "interface_binding_type.h"
13 
14 namespace adtf
15 {
16 namespace streaming
17 {
18 namespace ant
19 {
20 
26  public ucom::catwo::object<IBindingObject, named_graph_object<IBindingServer>>
27 {
30 
31  public:
33  typedef std::pair<adtf::ucom::IObject, IBindingObject> iobject_resolve_type;
35  typedef std::pair<INamedGraphObject, IBindingObject> inamedgraphobject_resolve_type;
38 
40  template <typename T>
42 
43  protected:
48  cBindingServer(const char* strName);
49 
50  public:
51 
58  explicit cBindingServer(const char* strName,
59  const iobject_ptr<const IBindingType>& pBindingType,
60  const iobject_ptr<IObject>& pServerObject);
63 
64  public: //Implements IBindingObject
65  tResult GetBindingType(iobject_ptr<const IBindingType>& pBindingType) const override;
66  tResult GetServerObject(iobject_ptr<IObject>& ppServerObject) const override;
67  tResult GetBindingProxy(iobject_ptr<IBindingProxy>& pBindingProxy) const override;
68  tResult Unbind() override;
69 
70  public: //Implements adtf::IBindingServer
71  tResult Bind(const iobject_ptr<IBindingProxy>& pBindingProxy) override;
72 
73  public:
84 
85 };
86 
87 
98  public ucom::catwo::object<IBindingObject, named_graph_object<IBindingClient>>
99 {
102 
103  public:
105  typedef std::pair<adtf::ucom::IObject, IBindingObject> iobject_resolve_type;
107  typedef std::pair<INamedGraphObject, IBindingObject> inamedgraphobject_resolve_type;
109 
110 
111  protected:
114 
115  public:
116 
122  explicit cBindingClient(const char* strName,
123  const ucom::ant::iobject_ptr<const IBindingType>& pInterfaceType);
126 
127  public: //Implements adtf::IBindingObject
128  tResult GetBindingType(ucom::ant::iobject_ptr<const IBindingType>& pBindingType) const override;
129  tResult GetServerObject(ucom::ant::iobject_ptr<ucom::ant::IObject>& pServerObject) const override;
130  tResult GetBindingProxy(ucom::ant::iobject_ptr<IBindingProxy>& pBindingProxy) const override;
131  tResult Unbind() override;
132 
133  public:
134  tResult Bind(const ucom::ant::iobject_ptr<IBindingProxy>& pBindingProxy) override;
135 
136  public:
153 };
154 
155 
156 
157 } // namespace ant
158 
159 namespace elasto
160 {
161 
169  public ucom::catwo::object<ant::IBindingObject, ant::named_graph_object<ant::IBindingServer>>
170 {
171  private:
173 
174  public:
181  cWeakBindingServer(const char* strName,
183  const ucom::ant::iobject_ptr<ucom::ant::IObject>& pServerObject);
184 
185  tResult GetBindingType(ucom::ant::iobject_ptr<const ant::IBindingType>& pBindingType) const override;
186  tResult GetServerObject(ucom::ant::iobject_ptr<ucom::ant::IObject>& pServerObject) const override;
187  tResult GetBindingProxy(ucom::ant::iobject_ptr<ant::IBindingProxy>& pBindingProxy) const override;
188  tResult Unbind() override;
189  tResult Bind(const ucom::ant::iobject_ptr<ant::IBindingProxy>& pBindingProxy) override;
190 
191  private:
192  util::cString GetServerObjectName() const;
193 };
194 
202 template <typename Interface, typename InterfaceBinding>
203 tResult create_weak_binding_server(InterfaceBinding& oInterfaceBinding,
204  const char* strName,
205  const ucom::ant::iobject_ptr<Interface>& pObject)
206 {
208  ucom::make_object_ptr<cWeakBindingServer>(strName,
209  ucom::ucom_object_ptr_cast<IBindingType>(ucom::make_object_ptr<streaming::ant::binding_type<Interface>>()),
210  ucom::ucom_object_ptr_cast<ucom::ant::IObject>(pObject));
211  return oInterfaceBinding.RegisterBindingObject(pServer);
212 }
213 
214 }
215 
216 using ant::cBindingServer;
217 using ant::cBindingClient;
218 using elasto::cWeakBindingServer;
220 
221 } // namespace streaming
222 } // namespace adtf
Binding type generation template to initialize a BindingType with the information of the INTERFACE ty...
Default Implementation of adtf::IDynamicBindingObject for one binding object that is able to connect ...
tResult SetBindingType(const ucom::ant::iobject_ptr< const IBindingType > &pBindingType)
Sets the Bindingtype.
std::pair< INamedGraphObject, IBindingObject > inamedgraphobject_resolve_type
object resolver
virtual tResult SetServerObject(const ucom::ant::iobject_ptr< ucom::ant::IObject > &pServerObject)
Sets the ServerObject of the BindingClient.
std::pair< adtf::ucom::IObject, IBindingObject > iobject_resolve_type
private dpointer
cBindingClient(const char *strName, const ucom::ant::iobject_ptr< const IBindingType > &pInterfaceType)
CTOR to create the Binding Object.
Default Implementation of IBindingServer for a BindingObject that is able to connect to a IBindingPro...
cBindingServer(const char *strName)
CTOR with name initialization.
std::pair< INamedGraphObject, IBindingObject > inamedgraphobject_resolve_type
resolving type
tResult SetBindingType(const iobject_ptr< const IBindingType > &pBindingType)
Sets the BindingType of the BindingServer .
std::pair< adtf::ucom::IObject, IBindingObject > iobject_resolve_type
pricate d-pointer
UCOM_RESOLVE(inamedgraphobject_resolve_type, iobject_resolve_type)
Resolve multiple inheritance from IObject.
tResult SetServerObject(const iobject_ptr< IObject > &pServerObject)
Sets the ServerObject of the BindingServer .
cBindingServer(const char *strName, const iobject_ptr< const IBindingType > &pBindingType, const iobject_ptr< IObject > &pServerObject)
CTOR to create the BindingServer.
Default Implementation of IBindingServer for a BindingObject that is able to connect to a IBindingPro...
cWeakBindingServer(const char *strName, const ucom::ant::iobject_ptr< const ant::IBindingType > &pBindingType, const ucom::ant::iobject_ptr< ucom::ant::IObject > &pServerObject)
CTOR to create the BindingServer.
Base object pointer to realize binary compatible reference counting in interface methods.
Object pointer implementation used for reference counting on objects of type IObject.
Definition: object_ptr.h:163
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Definition: object.h:379
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
Definition: d_ptr.h:270
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
Definition: string.h:2778
tResult create_weak_binding_server(InterfaceBinding &oInterfaceBinding, const char *strName, const ucom::ant::iobject_ptr< Interface > &pObject)
This method creates and registers a new weak binding server (adtf::streaming::elasto::cWeakBindingSer...
std::enable_if< !std::is_base_of< enable_object_ptr_from_this< typename std::remove_cv< Implementation >::type >, typename std::remove_cv< Implementation >::type >::value, object_ptr< Implementation > >::type make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Namespace for entire ADTF SDK.