ADTF  3.18.2
named_graph_object.h
Go to the documentation of this file.
1 
7 #pragma once
9 
10 #include <adtfucom3/adtf_ucom3.h>
11 #include <adtfbase/adtf_base.h>
12 
13 #include <string>
14 
15 namespace adtf
16 {
17 namespace streaming
18 {
19 namespace 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;
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  }
64  tResult SetName(const char* strName) override
65  {
66  m_strName = strName;
68  }
74  tResult GetName(base::ant::IString&& strName) const override
75  {
76  strName.Set(m_strName);
78  }
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  {
119  LOG_DUMP(A_UTILS_NS::cString::Format("%s : %s", strFullName.GetPtr(), strMessage));
120  }
121  };
122 
123 } //namespace ant
124 
125 namespace 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.
#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,...)
Write formatted data to a string.
Definition: string.h:2399
The IString interface provides methods for getting and setting strings through abstract interfaces.
Definition: string_intf.h:28
Default convenient implementation for INamedGraphObject.
named_graph_object & operator=(named_graph_object &&)=delete
delete move operator
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
adtf_util::cString m_strName
name of the
const ucom::ant::IObject * m_pParent
parent of the named object
named_graph_object & operator=(const named_graph_object &)=delete
delete copy 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:31
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Definition: object.h:379
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
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 entire ADTF SDK.