ADTF  3.18.2
legacy_streaming_source.h
Go to the documentation of this file.
1 
7 #ifndef _ADTF_ADTF2_LEGACY_STREAMING_SOURCE_HEADER_
8 #define _ADTF_ADTF2_LEGACY_STREAMING_SOURCE_HEADER_
9 
10 namespace adtf
11 {
12 namespace adtf2
13 {
14 namespace ant
15 {
16 
25  public cKernelAndClockHelper,
26  public cConfigurationHelper<cLegacyStreamingSource>,
27  public cLegacyStateHandler
28 {
29  protected:
34  virtual tResult Construct()
35  {
36  RETURN_IF_FAILED(Init(cLegacyStateHandler::StageFirst));
37  return Init(cLegacyStateHandler::StageNormal);
38  }
39 
44  virtual tResult Destruct()
45  {
46  RETURN_IF_FAILED(Shutdown(cLegacyStateHandler::StageNormal));
47  return Shutdown(cLegacyStateHandler::StageFirst);
48  }
49 
54  virtual tResult Init()
55  {
56  return Init(cLegacyStateHandler::StageGraphReady);
57  }
58 
63  virtual tResult Shutdown()
64  {
65  return Shutdown(cLegacyStateHandler::StageGraphReady);
66  }
67 
73  {
74  return Start();
75  }
76 
82  {
83  return Stop();
84  }
85 
86  protected:
87  // these methods are defined here as well in order to allow easy access via
88  // cLegacyStreamingSource:: prefix.
89 
93  tResult Init(tInitStage /* eStage */) override
94  {
96  }
97 
101  tResult Start() override
102  {
104  }
105 
109  tResult Stop() override
110  {
112  }
113 
117  tResult Shutdown(tInitStage /* eStage */) override
118  {
120  }
121 
122  protected:
130  {
131  adtf_util::cString strNameOfWriterAndPin;
132  RETURN_IF_FAILED(oOutput.GetName(adtf_string_intf(strNameOfWriterAndPin)));
133  auto pOutPin = adtf::ucom::make_object_ptr<adtf::streaming::ant::cOutPin>(strNameOfWriterAndPin);
134  oOutput.ResetPin(pOutPin);
136  oOutput.SetManualTriggerRequired(true);
137  return cSampleStreamingSource::RegisterPin(pPin);
138  }
139 
145  {
146  adtf_util::cString strName;
147  GetName(adtf_string_intf(strName));
148  return strName;
149  }
150 };
151 
152 }
153 
154 using ant::cLegacyStreamingSource;
155 
156 }
157 }
158 
159 
160 #endif
#define RETURN_IF_FAILED(s)
Return if expression is failed, which requires the calling function's return type to be tResult.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Common base class for all legacy filter classes that emulates the old configuration interface.
Common base class for all legacy filter classes.
This class helps when porting ADTF 2 Filters to ADTF 3.
Definition: legacy_filter.h:61
void SetManualTriggerRequired(bool bManualTriggerRequired)
For internal use only.
Definition: legacy_filter.h:97
Common base class for all legacy filter classes that emulates the old state maschine of cFilter.
Class that helps with porting old ADTF 2 Filters to ADTF 3.
tResult Shutdown(tInitStage) override
Emulates the old Shutdown method.
tResult Init(tInitStage) override
Emulates the old Init method.
tResult RegisterPin(cLegacyOutputPin &oOutput)
Compatibility method to register Pins.
virtual tResult StopStreaming()
Used internally.
virtual tResult Construct()
Used internally.
adtf_util::cString OIGetInstanceName()
Compatibility method to retrieve the name of the current filter instance.
virtual tResult StartStreaming()
Used internally.
virtual tResult Shutdown()
Used internally.
tResult Stop() override
Emulates the old Stop method.
tResult Start() override
Emulates the old Start method.
virtual tResult Init()
Used internally.
virtual tResult Destruct()
Used internally.
void ResetPin(ucom::ant::object_ptr< PINTYPE > &pPin)
Resets the pin reference This is only internaly used.
Definition: samplereader.h:95
tResult GetName(base::ant::IString &&strName) const
Gets the name of the streamer.
Definition: samplereader.h:129
Basic implementation for a Streaming Source.
Object pointer implementation used for reference counting on objects of type IObject.
Definition: object_ptr.h:163
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
Namespace for entire ADTF SDK.
#define adtf_string_intf(__string__)
The adtf_string_intf Macro helps to easily create a rvalue reference of a adtf::util::cString.
Definition: string_intf.h:371