ADTF  3.18.2
streammetatypesubstreams.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include <adtf_utils.h>
9 #include <adtfucom3/adtf_ucom3.h>
10 #include "streamtype_intf.h"
11 #include "streamtype.h"
12 #include <functional>
13 #include <type_traits>
14 #include <string_view>
15 
16 namespace adtf
17 {
18 namespace streaming
19 {
20 namespace hollow
21 {
22 
32 {
37 
39  static constexpr const tChar* const MetaTypeName = "adtf/substreams";
45  static constexpr const tChar* const SubStreams = "substreams";
50  static constexpr const tChar* const SubStreamsRequestProperties = "substreams_request_properties";
51 
57 
76  const adtf::streaming::ant::IStreamType& oTypeExpected);
77 
82  static bool HasSubStreams(const ant::IStreamType& oStreamType);
83 
89  static void ListSubStreams(const ant::IStreamType& oStreamType, std::function<void(const char*)> fnCallback);
90 
96  static void ListSubStreams(const ant::IStreamType& oStreamType, std::function<void(const char*, uint32_t)> fnCallback);
97 
103  static void ListSubStreams(const ant::IStreamType& oStreamType, std::function<void(std::string_view strName, uint32_t nId, const ucom::ant::iobject_ptr<const ant::IStreamType>& pType)> fnCallback);
104 
112  static uint32_t GetSubStreamId(const ant::IStreamType& oStreamType, const char* strSubStreamName);
113 
121  static ucom::ant::object_ptr<const ant::IStreamType> GetSubStreamType(const ant::IStreamType& oStreamType, const char* strSubStreamName);
122 
129  static void GetRequestProperties(base::ant::IProperties& oProperties, const ant::IStreamType& oStreamType, const char* strSubStreamName = "");
130 };
131 
137 {
138  public:
144  template <typename MetaType = stream_meta_type_substreams, typename = std::enable_if_t<is_stream_meta_type<MetaType>::value, MetaType>>
145  cSubStreamTypes(const MetaType& /*oMetaType*/ = MetaType()):
147  {
148  }
149 
155 
159  virtual ~cSubStreamTypes();
160 
167  void SetSubStream(const char* strName, uint32_t nSubStreamId, const ucom::ant::iobject_ptr<const ant::IStreamType>& pType);
168 
175  void SetSubStream(std::string_view strName, uint32_t nSubStreamId, const ucom::ant::iobject_ptr<const ant::IStreamType>& pType);
176 
182  void SetRequestProperties(const base::ant::IProperties& oProperties, const char* strSubStreamName = "");
183 
190 
198 
199  protected:
200  class cImplementation;
201  std::unique_ptr<cImplementation> m_pImplementation;
202 };
203 
204 } // namespace hollow
205 
207 
208 } // namespace streaming
209 } // namespace adtf
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
Defintion of a property set container interface.
Defines access methods for a Stream Meta Type - see also Stream Type and Stream Meta Type for more in...
Defines access methods for the interface of a Stream Type - see also Stream Type and Stream Meta Type...
Generator template stream_meta_type to create a StreamMetaType Class for the Type T.
Definition: streamtype.h:234
Helper class to create a stream type with multiple Substreams.
void SetSubStream(std::string_view strName, uint32_t nSubStreamId, const ucom::ant::iobject_ptr< const ant::IStreamType > &pType)
Adds or updates a Substream.
ucom::ant::object_ptr< ant::IStreamType > GetStreamType() const
Get a Stream Type that contains all currently set Substreams.
void SetSubStream(const char *strName, uint32_t nSubStreamId, const ucom::ant::iobject_ptr< const ant::IStreamType > &pType)
Adds or updates a Substream.
cSubStreamTypes(const ucom::ant::iobject_ptr< const ant::IStreamMetaType > &pMetaType)
Constructor.
void SetRequestProperties(const base::ant::IProperties &oProperties, const char *strSubStreamName="")
Sets the common or Substream specific request properties.
ucom::ant::object_ptr< const streaming::ant::IStreamType > GetSubStreamType(const char *strName) const
Retrieve the Stream Type of a given Substream.
cSubStreamTypes(const MetaType &=MetaType())
Constructor.
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
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.
object_ptr< T > ucom_object_ptr_cast(const iobject_ptr< U > &i_oOther)
Create an object_ptr with an already shared resource of implicitly convertible type.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Use cSubStreamTypes to create a Stream Type instance for this Stream Meta Type - see also Substreams.
static void SetProperties(const adtf::ucom::ant::iobject_ptr< adtf::base::ant::IProperties > &pProperties)
Sets the default properties to the given pProperties.
static void ListSubStreams(const ant::IStreamType &oStreamType, std::function< void(const char *)> fnCallback)
List all available Substreams.
static void ListSubStreams(const ant::IStreamType &oStreamType, std::function< void(const char *, uint32_t)> fnCallback)
List all available Substreams.
static bool HasSubStreams(const ant::IStreamType &oStreamType)
static ucom::ant::object_ptr< const ant::IStreamType > GetSubStreamType(const ant::IStreamType &oStreamType, const char *strSubStreamName)
Extracts the Stream Type of a specific Substream.
static constexpr const tChar *const SubStreams
The name of the substreams property.
static constexpr const tChar *const SubStreamsRequestProperties
The name of the substreams request property.
static constexpr const tChar *const MetaTypeName
The unique name of this meta type.
static uint32_t GetSubStreamId(const ant::IStreamType &oStreamType, const char *strSubStreamName)
Returns the Substream id of a given Substream.
static void ListSubStreams(const ant::IStreamType &oStreamType, std::function< void(std::string_view strName, uint32_t nId, const ucom::ant::iobject_ptr< const ant::IStreamType > &pType)> fnCallback)
List all available Substreams.
static void GetRequestProperties(base::ant::IProperties &oProperties, const ant::IStreamType &oStreamType, const char *strSubStreamName="")
Extracts the common or Substream specific request Properties.
static tResult IsCompatible(const adtf::streaming::ant::IStreamType &oTypeToCheck, const adtf::streaming::ant::IStreamType &oTypeExpected)
Compares the oTypeExpected Stream Type with the oTypeToCheck - see Default Stream Meta Types in ADTF ...