ADTF
Loading...
Searching...
No Matches
named_graph_object.h
Go to the documentation of this file.
1
7#pragma once
9
11#include <adtfbase/adtf_base.h>
12
13#include <string>
14
15namespace adtf
16{
17namespace streaming
18{
19namespace ant
20{
29 template <typename INTERFACE = INamedGraphObject>
30 class named_graph_object : public ucom::catwo::object<INamedGraphObject, INTERFACE>
31 {
32 private:
34 const ucom::ant::IObject* m_pParent = nullptr;
36 adtf_util::cString m_strName;
37
38 protected:
47
48 public:
52 virtual ~named_graph_object() = default;
53
56 named_graph_object(const char* strName) : m_strName(strName)
57 {
58 }
59
64 tResult SetName(const char* strName) override
65 {
66 m_strName = strName;
68 }
69
74 tResult GetName(base::ant::IString&& strName) const override
75 {
76 strName.Set(m_strName);
78 }
79
85 tResult SetParent(const ucom::ant::IObject* poParentObject) override
86 {
87 m_pParent = poParentObject;
89 }
90
97 tResult GetParent(const ucom::ant::IObject*& poParentObject) const override
98 {
99 if (m_pParent)
100 {
101 poParentObject = m_pParent;
103 }
104 else
105 {
106 RETURN_ERROR(ERR_NOT_INITIALIZED);
107 }
108 }
109
110 protected:
116 void LogNamedMessage(const char* strMessage)
117 {
118 adtf_util::cString strFullName = get_named_graph_object_full_name(*this);
119 LOG_DUMP("%s : %s", strFullName.GetPtr(), strMessage);
120 }
121 };
122
123} //namespace ant
124
125namespace flash
126{
127
129{
130 public:
131 tResult GetName(base::ant::IString&& strName) const;
132 tResult SetName(const char* strName);
133 tResult SetParent(const ucom::ant::IObject* pParentObject);
134 tResult GetParent(const ucom::ant::IObject*& poParentObject) const;
135
136 protected:
140 std::string m_strName;
141};
142
143}
144
148
149} //namespace streaming
150} //namespace adtf
#define LOG_DUMP(...)
Logs a dump message.
Definition log.h:382
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Definition result.h:29
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
Definition result.h:42
Definition string_intf.h:29
Definition named_graph_object.h:31
named_graph_object()
CTOR.
Definition named_graph_object.h:50
named_graph_object & operator=(const named_graph_object &)=delete
delete copy operator
named_graph_object & operator=(named_graph_object &&)=delete
delete move operator
named_graph_object(named_graph_object &&)=delete
delete move CTOR
tResult GetParent(const ucom::ant::IObject *&poParentObject) const override
Definition named_graph_object.h:97
tResult GetName(base::ant::IString &&strName) const override
Definition named_graph_object.h:74
tResult SetParent(const ucom::ant::IObject *poParentObject) override
Definition named_graph_object.h:85
virtual ~named_graph_object()=default
DTOR.
named_graph_object(const char *strName)
Definition named_graph_object.h:56
void LogNamedMessage(const char *strMessage)
Definition named_graph_object.h:116
named_graph_object(const named_graph_object &)=delete
delete copy CTOR
tResult SetName(const char *strName) override
Definition named_graph_object.h:64
Definition named_graph_object.h:129
std::string m_strName
name of the
Definition named_graph_object.h:140
const adtf::ucom::ant::IObject * m_pParent
parent of the named object
Definition named_graph_object.h:138
Definition object_intf.h:33
Definition object.h:397
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
Definition bindingproxyoutport.h:16
adtf_util::cString get_named_graph_object_full_name(const INamedGraphObject &oGraphObject)
Namespace for the ADTF Streaming SDK.
Definition bindingproxyinport.h:14
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14