68 # pragma warning(push)
69 # pragma warning(disable : 4251)
82 static constexpr
const char *path{
"" };
85 static constexpr
const char *name{
"FrameInfo" };
88 static constexpr
const char *description{ R
"description(Various information for a frame)description" };
90 static constexpr
size_t version{ 2 };
100 static constexpr std::array<uint8_t, 3> binaryId{
'f',
'i',
'f' };
112 static constexpr
const char *path{
"SoftwareVersion" };
115 static constexpr
const char *name{
"SoftwareVersion" };
118 static constexpr
const char *description{
119 R
"description(The version information for installed software at the time of image capture)description"
130 static constexpr
const char *path{
"SoftwareVersion/Core" };
133 static constexpr
const char *name{
"Core" };
136 static constexpr
const char *description{ R
"description(Core version)description" };
144 return { 0, std::numeric_limits<ValueType::size_type>::max() };
151 explicit Core(std::string value)
152 : m_value{ std::move(value) }
164 return m_value == other.m_value;
170 return m_value != other.m_value;
176 return m_value < other.m_value;
182 return m_value > other.m_value;
192 void setFromString(
const std::string &value);
194 std::string m_value{
"No-version" };
196 friend struct DataModel::Detail::Befriend<
Core>;
216 template<
typename... Args,
217 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
218 typename std::enable_if<
219 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
220 typename std::decay<Args>::type...>::value,
223 template<typename... Args>
227 using namespace Zivid::Detail::TypeTraits;
229 static_assert(AllArgsDecayedAreUnique<Args...>::value,
230 "Found duplicate types among the arguments passed to SoftwareVersion(...). "
231 "Types should be listed at most once.");
233 set(std::forward<Args>(args)...);
247 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
249 template<typename... Args>
253 using namespace Zivid::Detail::TypeTraits;
255 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
256 static_assert(AllArgsAreDescendantNodes::value,
257 "All arguments passed to set(...) must be descendant nodes.");
259 static_assert(AllArgsDecayedAreUnique<Args...>::value,
260 "Found duplicate types among the arguments passed to set(...). "
261 "Types should be listed at most once.");
263 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
278 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
280 template<typename... Args>
284 using namespace Zivid::Detail::TypeTraits;
286 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
287 static_assert(AllArgsAreDescendantNodes::value,
288 "All arguments passed to copyWith(...) must be descendant nodes.");
290 static_assert(AllArgsDecayedAreUnique<Args...>::value,
291 "Found duplicate types among the arguments passed to copyWith(...). "
292 "Types should be listed at most once.");
295 copy.set(std::forward<Args>(args)...);
319 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value,
int>::type = 0>
325 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
361 void setFromString(
const std::string &value);
363 void setFromString(
const std::string &fullPath,
const std::string &value);
365 std::string getString(
const std::string &fullPath)
const;
380 static constexpr
const char *path{
"TimeStamp" };
383 static constexpr
const char *name{
"TimeStamp" };
386 static constexpr
const char *description{ R
"description(The time of frame capture)description" };
389 using ValueType = std::chrono::system_clock::time_point;
394 return { std::chrono::system_clock::time_point::min(), std::chrono::system_clock::time_point::max() };
401 explicit constexpr
TimeStamp(std::chrono::system_clock::time_point value)
406 std::chrono::system_clock::time_point
value()
const;
414 return m_value == other.m_value;
420 return m_value != other.m_value;
426 return m_value < other.m_value;
432 return m_value > other.m_value;
442 void setFromString(
const std::string &value);
444 std::chrono::system_clock::time_point m_value{};
446 friend struct DataModel::Detail::Befriend<
TimeStamp>;
450 std::tuple<FrameInfo::SoftwareVersion, FrameInfo::SoftwareVersion::Core, FrameInfo::TimeStamp>;
474 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
475 typename std::enable_if<
476 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::value,
479 template<typename... Args>
483 using namespace Zivid::Detail::TypeTraits;
485 static_assert(AllArgsDecayedAreUnique<Args...>::value,
486 "Found duplicate types among the arguments passed to FrameInfo(...). "
487 "Types should be listed at most once.");
489 set(std::forward<Args>(args)...);
505 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
507 template<typename... Args>
511 using namespace Zivid::Detail::TypeTraits;
513 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
514 static_assert(AllArgsAreDescendantNodes::value,
515 "All arguments passed to set(...) must be descendant nodes.");
517 static_assert(AllArgsDecayedAreUnique<Args...>::value,
518 "Found duplicate types among the arguments passed to set(...). "
519 "Types should be listed at most once.");
521 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
538 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
540 template<typename... Args>
544 using namespace Zivid::Detail::TypeTraits;
546 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
547 static_assert(AllArgsAreDescendantNodes::value,
548 "All arguments passed to copyWith(...) must be descendant nodes.");
550 static_assert(AllArgsDecayedAreUnique<Args...>::value,
551 "Found duplicate types among the arguments passed to copyWith(...). "
552 "Types should be listed at most once.");
555 copy.set(std::forward<Args>(args)...);
562 return m_softwareVersion;
568 return m_softwareVersion;
574 m_softwareVersion = value;
581 m_softwareVersion.
set(value);
604 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion>::value,
int>::type = 0>
607 return m_softwareVersion;
611 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value,
int>::type = 0>
617 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::TimeStamp>::value,
int>::type = 0>
623 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
626 return m_softwareVersion;
629 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
639 f(m_softwareVersion);
647 f(m_softwareVersion);
667 void save(
const std::string &fileName)
const;
670 void load(
const std::string &fileName);
673 void setFromString(
const std::string &value);
675 void setFromString(
const std::string &fullPath,
const std::string &value);
677 std::string getString(
const std::string &fullPath)
const;
682 friend struct DataModel::Detail::Befriend<
FrameInfo>;
687 struct FrameInfo::Version<2>
696 # pragma warning(pop)
700 # if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
704 struct tuple_size<
Zivid::FrameInfo::SoftwareVersion> : integral_constant<size_t, 1>
708 struct tuple_element<i,
Zivid::FrameInfo::SoftwareVersion>
710 static_assert(i < tuple_size<Zivid::FrameInfo::SoftwareVersion>::value,
"Index must be less than 1");
713 = decltype(declval<Zivid::FrameInfo::SoftwareVersion>().get<i>());
717 struct tuple_size<
Zivid::FrameInfo> : integral_constant<size_t, 2>
721 struct tuple_element<i,
Zivid::FrameInfo>
723 static_assert(i < tuple_size<Zivid::FrameInfo>::value,
"Index must be less than 2");
726 = decltype(declval<Zivid::FrameInfo>().get<i>());
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:57
Core version
Definition: FrameInfo.h:124
std::string toString() const
Get the value as string
bool operator!=(const Core &other) const
Comparison operator
Definition: FrameInfo.h:168
Core(std::string value)
Constructor
Definition: FrameInfo.h:151
friend std::ostream & operator<<(std::ostream &stream, const Core &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:186
const std::string & value() const
Get the value
bool operator==(const Core &other) const
Comparison operator
Definition: FrameInfo.h:162
Core()=default
Default constructor
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Core
Definition: FrameInfo.h:142
bool operator>(const Core &other) const
Comparison operator
Definition: FrameInfo.h:180
bool operator<(const Core &other) const
Comparison operator
Definition: FrameInfo.h:174
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:139
The version information for installed software at the time of image capture
Definition: FrameInfo.h:106
SoftwareVersion & set(const Core &value)
Set Core
Definition: FrameInfo.h:312
bool operator!=(const SoftwareVersion &other) const
Inequality operator
bool operator==(const SoftwareVersion &other) const
Equality operator
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:340
SoftwareVersion()
Default constructor
const FrameInfo::SoftwareVersion::Core & get() const
Definition: FrameInfo.h:320
SoftwareVersion copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: FrameInfo.h:282
const Core & core() const
Get Core
Definition: FrameInfo.h:300
SoftwareVersion(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:225
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:333
Core & core()
Get Core
Definition: FrameInfo.h:306
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:251
friend std::ostream & operator<<(std::ostream &stream, const SoftwareVersion &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:355
std::tuple< FrameInfo::SoftwareVersion::Core > Descendants
Definition: FrameInfo.h:199
std::string toString() const
Get the value as string
The time of frame capture
Definition: FrameInfo.h:374
std::chrono::system_clock::time_point value() const
Get the value
bool operator>(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:430
bool operator<(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:424
std::string toString() const
Get the value as string
TimeStamp()=default
Default constructor
constexpr TimeStamp(std::chrono::system_clock::time_point value)
Constructor
Definition: FrameInfo.h:401
bool operator!=(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:418
friend std::ostream & operator<<(std::ostream &stream, const TimeStamp &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:436
bool operator==(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:412
static constexpr Range< std::chrono::system_clock::time_point > validRange()
The range of valid values for TimeStamp
Definition: FrameInfo.h:392
std::chrono::system_clock::time_point ValueType
The type of the underlying value
Definition: FrameInfo.h:389
Various information for a frame
Definition: FrameInfo.h:76
std::string toString() const
Get the value as string
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:637
FrameInfo()
Default constructor
FrameInfo & set(const SoftwareVersion::Core &value)
Set SoftwareVersion::Core
Definition: FrameInfo.h:579
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:509
void save(const std::string &fileName) const
Save to the given file
const TimeStamp & timeStamp() const
Get TimeStamp
Definition: FrameInfo.h:586
SoftwareVersion & softwareVersion()
Get SoftwareVersion
Definition: FrameInfo.h:566
FrameInfo(const std::string &fileName)
Construct FrameInfo by loading from file
const FrameInfo::SoftwareVersion::Core & get() const
Definition: FrameInfo.h:612
FrameInfo(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:481
const FrameInfo::TimeStamp & get() const
Definition: FrameInfo.h:618
const SoftwareVersion & softwareVersion() const
Get SoftwareVersion
Definition: FrameInfo.h:560
friend std::ostream & operator<<(std::ostream &stream, const FrameInfo &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:661
TimeStamp & timeStamp()
Get TimeStamp
Definition: FrameInfo.h:592
const FrameInfo::SoftwareVersion & get() const
Definition: FrameInfo.h:605
FrameInfo & set(const SoftwareVersion &value)
Set SoftwareVersion
Definition: FrameInfo.h:572
FrameInfo & set(const TimeStamp &value)
Set TimeStamp
Definition: FrameInfo.h:598
bool operator!=(const FrameInfo &other) const
Inequality operator
std::tuple< FrameInfo::SoftwareVersion, FrameInfo::SoftwareVersion::Core, FrameInfo::TimeStamp > Descendants
Definition: FrameInfo.h:450
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:645
bool operator==(const FrameInfo &other) const
Equality operator
void load(const std::string &fileName)
Load from the given file
FrameInfo copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: FrameInfo.h:542
Class describing a range of values for a given type T
Definition: Range.h:58
NodeType
Definition: NodeType.h:56
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:55