adtf_file_library  0.13.2
stream_type.h
Go to the documentation of this file.
1 
17 #ifndef ADTF_FILE_STREAM_TYPE
18 #define ADTF_FILE_STREAM_TYPE
19 
20 #include <string>
21 #include <unordered_map>
22 #include <functional>
23 #include "stream_item.h"
24 
25 namespace adtf_file
26 {
27 
32 {
33  public:
38  virtual void setMetaType(const std::string& meta_type) = 0;
46  virtual PropertyStreamType& setProperty(const std::string& name, const std::string& type, const std::string& value) = 0;
51  virtual std::string getMetaType() const = 0;
57  virtual std::pair<std::string, std::string> getProperty(const std::string& name) const = 0;
62  virtual void iterateProperties(std::function<void(const char*, const char*, const char*)> functor) const = 0;
63 };
64 
69 {
70  public:
74  DefaultStreamType() = default;
79  DefaultStreamType(const std::string& meta_type);
80 
81  void setMetaType(const std::string& meta_type) override;
82  PropertyStreamType& setProperty(const std::string& name, const std::string& type, const std::string& value) override;
83 
84  std::string getMetaType() const override;
85  std::pair<std::string, std::string> getProperty(const std::string& name) const override;
86  void iterateProperties(std::function<void(const char*, const char*, const char*)> functor) const override;
87 
88  private:
89  std::string _meta_type;
90  std::unordered_map<std::string, std::pair<std::string, std::string>> _properties;
91 };
92 
93 
94 }
95 
96 #endif
Default stream type implementation.
Definition: stream_type.h:69
void iterateProperties(std::function< void(const char *, const char *, const char *)> functor) const override
iterates the properties
DefaultStreamType()=default
CTOR.
PropertyStreamType & setProperty(const std::string &name, const std::string &type, const std::string &value) override
Set a Property.
void setMetaType(const std::string &meta_type) override
Set the Meta Type.
std::string getMetaType() const override
Get the Meta Type.
std::pair< std::string, std::string > getProperty(const std::string &name) const override
Get a Property.
DefaultStreamType(const std::string &meta_type)
CTOR.
The default interface class for stream types.
Definition: stream_type.h:32
virtual std::string getMetaType() const =0
Get the Meta Type.
virtual std::pair< std::string, std::string > getProperty(const std::string &name) const =0
Get a Property.
virtual void iterateProperties(std::function< void(const char *, const char *, const char *)> functor) const =0
iterates the properties
virtual void setMetaType(const std::string &meta_type)=0
Set the Meta Type.
virtual PropertyStreamType & setProperty(const std::string &name, const std::string &type, const std::string &value)=0
Set a Property.
Stream Type base class.
Definition: stream_item.h:43
namespace for ADTF File library
Definition: adtf2_adtf_core_media_sample_deserializer.h:25

Copyright © CARIAD SE.
Generated on Mon Jun 10 2024 by doxygen 1.9.1
GIT Commit Hash: eb3af397a6b49ad6fcad9a60d8277d909b458b48