3#include <unordered_map>
8#include <boost/serialization/vector.hpp>
9#include "declarative/PropertyMacros.h"
37 auto noOfFiles =
files.size();
38 for (
auto i = 0; i < noOfFiles; i++)
40 len +=
files[i].length();
56 template<
typename PropsT>
59 const std::map<std::string, apra::ScalarPropertyValue>& values,
60 std::vector<std::string>& missingRequired
62 apra::applyProp(props.strFullFileNameWithPattern,
"strFullFileNameWithPattern", values,
true, missingRequired);
63 apra::applyProp(props.startIndex,
"startIndex", values,
false, missingRequired);
64 apra::applyProp(props.maxIndex,
"maxIndex", values,
false, missingRequired);
65 apra::applyProp(props.readLoop,
"readLoop", values,
false, missingRequired);
71 if (propName ==
"startIndex")
return static_cast<int64_t
>(
startIndex);
72 if (propName ==
"maxIndex")
return static_cast<int64_t
>(
maxIndex);
73 if (propName ==
"readLoop")
return readLoop;
74 throw std::runtime_error(
"Unknown property: " + propName);
79 throw std::runtime_error(
"Cannot modify static property '" + propName +
"' after initialization");
90 template<
class Archive>
91 void serialize(Archive &ar,
const unsigned int version)
93 ar & boost::serialization::base_object<ModuleProps>(*
this);
109 bool jump(uint64_t index);
122 boost::shared_ptr<FileSequenceDriver>
mDriver;
CommandType
Definition Command.h:9
Definition FileReaderModule.h:16
string strFullFileNameWithPattern
Definition FileReaderModule.h:48
static void applyProperties(PropsT &props, const std::map< std::string, apra::ScalarPropertyValue > &values, std::vector< std::string > &missingRequired)
Definition FileReaderModule.h:57
bool readLoop
Definition FileReaderModule.h:49
size_t getSerializeSize()
Definition FileReaderModule.h:34
std::vector< std::string > files
Definition FileReaderModule.h:50
int startIndex
Definition FileReaderModule.h:46
FileReaderModuleProps()
Definition FileReaderModule.h:26
void serialize(Archive &ar, const unsigned int version)
Definition FileReaderModule.h:91
friend class boost::serialization::access
Definition FileReaderModule.h:88
static std::vector< std::string > dynamicPropertyNames()
Definition FileReaderModule.h:83
FileReaderModuleProps(const std::string &_strFullFileNameWithPattern, int _startIndex=0, int _maxIndex=-1)
Definition FileReaderModule.h:18
int maxIndex
Definition FileReaderModule.h:47
apra::ScalarPropertyValue getProperty(const std::string &propName) const
Definition FileReaderModule.h:69
bool setProperty(const std::string &propName, const apra::ScalarPropertyValue &value)
Definition FileReaderModule.h:78
Definition FileReaderModule.h:102
virtual ~FileReaderModule()
Definition FileReaderModule.cpp:14
void notifyPlay(bool play)
Definition FileReaderModule.cpp:114
bool handleCommand(Command::CommandType type, frame_sp &frame)
Definition FileReaderModule.cpp:126
FileReaderModuleProps getProps()
Definition FileReaderModule.cpp:146
bool handlePropsChange(frame_sp &frame)
Definition FileReaderModule.cpp:152
bool term()
Definition FileReaderModule.cpp:45
frame_container mFrames
Definition FileReaderModule.h:124
string mPinId
Definition FileReaderModule.h:121
bool jump(uint64_t index)
Definition FileReaderModule.cpp:119
boost::shared_ptr< FileSequenceDriver > mDriver
Definition FileReaderModule.h:122
FileReaderModuleProps mProps
Definition FileReaderModule.h:123
bool init()
Definition FileReaderModule.cpp:28
bool mCache
Definition FileReaderModule.h:125
FileReaderModule(FileReaderModuleProps _props)
Definition FileReaderModule.cpp:8
void setProps(FileReaderModuleProps &props)
Definition FileReaderModule.cpp:141
bool produce()
Definition FileReaderModule.cpp:51
bool validateOutputPins()
Definition FileReaderModule.cpp:16
Definition FileSequenceDriver.h:10
virtual size_t getSerializeSize()
Definition Module.h:101
bool play(float speed, bool direction=true)
Definition Module.cpp:1140
void applyProp(T &member, const char *propName, const std::map< std::string, ScalarPropertyValue > &values, bool isRequired, std::vector< std::string > &missingRequired)
Definition PropertyMacros.h:36
std::variant< int64_t, double, bool, std::string > ScalarPropertyValue
Definition ModuleRegistry.h:30