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(A_UTILS_NS::cString::Format("%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
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
static _myType Format(const value_type *strFormat,...)
Definition string.h:2406
The IString interface provides methods for getting and setting strings through abstract interfaces.
Definition string_intf.h:28
Default convenient implementation for INamedGraphObject.
void LogNamedMessage(const char *strMessage)
Helper to log a message with the full name of the object.
named_graph_object(named_graph_object &&)=delete
delete move CTOR
tResult GetParent(const ucom::ant::IObject *&poParentObject) const override
Gets the Parent of the object.
tResult GetName(base::ant::IString &&strName) const override
Gets the Name of the object.
tResult SetName(const char *strName) override
Sets the Name of the object.
named_graph_object(const char *strName)
CTOR with name.
named_graph_object(const named_graph_object &)=delete
delete copy CTOR
named_graph_object & operator=(const named_graph_object &)=delete
delete copy operator
named_graph_object & operator=(named_graph_object &&)=delete
delete move operator
virtual ~named_graph_object()=default
DTOR.
tResult SetParent(const ucom::ant::IObject *poParentObject) override
Sets Parent of the object.
const adtf::ucom::ant::IObject * m_pParent
parent of the named object
Base class for every interface type within the uCOM.
Definition object_intf.h:33
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Definition object.h:397
Copyright © Audi Electronics Venture GmbH.
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
adtf_util::cString get_named_graph_object_full_name(const INamedGraphObject &oGraphObject)
Helper function to retrieve a full qualified unique name of an object registered in IFilterGraph.
Namespace for the ADTF Streaming SDK.
Namespace for entire ADTF SDK.