112 # pragma warning(push)
113 # pragma warning(disable : 4251)
126 static constexpr
const char *path{
"" };
129 static constexpr
const char *name{
"FrameInfo" };
132 static constexpr
const char *description{ R
"description(Various information for a frame)description" };
134 static constexpr
size_t version{ 2 };
144 static constexpr std::array<uint8_t, 3> binaryId{
'f',
'i',
'f' };
156 static constexpr
const char *path{
"SoftwareVersion" };
159 static constexpr
const char *name{
"SoftwareVersion" };
162 static constexpr
const char *description{
163 R
"description(The version information for installed software at the time of image capture)description"
174 static constexpr
const char *path{
"SoftwareVersion/Core" };
177 static constexpr
const char *name{
"Core" };
180 static constexpr
const char *description{ R
"description(Core version)description" };
188 return { 0, std::numeric_limits<ValueType::size_type>::max() };
195 explicit Core(std::string value)
196 : m_value{ std::move(value) }
208 return m_value == other.m_value;
214 return m_value != other.m_value;
220 return m_value < other.m_value;
226 return m_value > other.m_value;
236 void setFromString(
const std::string &value);
238 std::string m_value{
"No-version" };
240 friend struct DataModel::Detail::Befriend<
Core>;
260 template<
typename... Args,
261 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
262 typename std::enable_if<
263 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
264 typename std::decay<Args>::type...>::value,
267 template<typename... Args>
271 using namespace Zivid::Detail::TypeTraits;
273 static_assert(AllArgsDecayedAreUnique<Args...>::value,
274 "Found duplicate types among the arguments passed to SoftwareVersion(...). "
275 "Types should be listed at most once.");
277 set(std::forward<Args>(args)...);
291 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
293 template<typename... Args>
297 using namespace Zivid::Detail::TypeTraits;
299 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
300 static_assert(AllArgsAreDescendantNodes::value,
301 "All arguments passed to set(...) must be descendant nodes.");
303 static_assert(AllArgsDecayedAreUnique<Args...>::value,
304 "Found duplicate types among the arguments passed to set(...). "
305 "Types should be listed at most once.");
307 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
322 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
324 template<typename... Args>
328 using namespace Zivid::Detail::TypeTraits;
330 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
331 static_assert(AllArgsAreDescendantNodes::value,
332 "All arguments passed to copyWith(...) must be descendant nodes.");
334 static_assert(AllArgsDecayedAreUnique<Args...>::value,
335 "Found duplicate types among the arguments passed to copyWith(...). "
336 "Types should be listed at most once.");
339 copy.set(std::forward<Args>(args)...);
363 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value,
int>::type = 0>
369 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
405 void setFromString(
const std::string &value);
407 void setFromString(
const std::string &fullPath,
const std::string &value);
409 std::string getString(
const std::string &fullPath)
const;
424 static constexpr
const char *path{
"TimeStamp" };
427 static constexpr
const char *name{
"TimeStamp" };
430 static constexpr
const char *description{ R
"description(The time of frame capture)description" };
433 using ValueType = std::chrono::system_clock::time_point;
438 return { std::chrono::system_clock::time_point::min(), std::chrono::system_clock::time_point::max() };
445 explicit constexpr
TimeStamp(std::chrono::system_clock::time_point value)
450 std::chrono::system_clock::time_point
value()
const;
458 return m_value == other.m_value;
464 return m_value != other.m_value;
470 return m_value < other.m_value;
476 return m_value > other.m_value;
486 void setFromString(
const std::string &value);
488 std::chrono::system_clock::time_point m_value{};
490 friend struct DataModel::Detail::Befriend<
TimeStamp>;
494 std::tuple<FrameInfo::SoftwareVersion, FrameInfo::SoftwareVersion::Core, FrameInfo::TimeStamp>;
518 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
519 typename std::enable_if<
520 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::value,
523 template<typename... Args>
527 using namespace Zivid::Detail::TypeTraits;
529 static_assert(AllArgsDecayedAreUnique<Args...>::value,
530 "Found duplicate types among the arguments passed to FrameInfo(...). "
531 "Types should be listed at most once.");
533 set(std::forward<Args>(args)...);
549 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
551 template<typename... Args>
555 using namespace Zivid::Detail::TypeTraits;
557 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
558 static_assert(AllArgsAreDescendantNodes::value,
559 "All arguments passed to set(...) must be descendant nodes.");
561 static_assert(AllArgsDecayedAreUnique<Args...>::value,
562 "Found duplicate types among the arguments passed to set(...). "
563 "Types should be listed at most once.");
565 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
582 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
584 template<typename... Args>
588 using namespace Zivid::Detail::TypeTraits;
590 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
591 static_assert(AllArgsAreDescendantNodes::value,
592 "All arguments passed to copyWith(...) must be descendant nodes.");
594 static_assert(AllArgsDecayedAreUnique<Args...>::value,
595 "Found duplicate types among the arguments passed to copyWith(...). "
596 "Types should be listed at most once.");
599 copy.set(std::forward<Args>(args)...);
606 return m_softwareVersion;
612 return m_softwareVersion;
618 m_softwareVersion = value;
625 m_softwareVersion.
set(value);
648 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion>::value,
int>::type = 0>
651 return m_softwareVersion;
655 typename std::enable_if<std::is_same<T, FrameInfo::SoftwareVersion::Core>::value,
int>::type = 0>
661 template<typename T, typename std::enable_if<std::is_same<T, FrameInfo::TimeStamp>::value,
int>::type = 0>
667 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
670 return m_softwareVersion;
673 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
683 f(m_softwareVersion);
691 f(m_softwareVersion);
711 void save(
const std::string &fileName)
const;
714 void load(
const std::string &fileName);
717 void setFromString(
const std::string &value);
719 void setFromString(
const std::string &fullPath,
const std::string &value);
721 std::string getString(
const std::string &fullPath)
const;
726 friend struct DataModel::Detail::Befriend<
FrameInfo>;
731 struct FrameInfo::Version<2>
740 # pragma warning(pop)
744 # if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
748 struct tuple_size<
Zivid::FrameInfo::SoftwareVersion> : integral_constant<size_t, 1>
752 struct tuple_element<i,
Zivid::FrameInfo::SoftwareVersion>
754 static_assert(i < tuple_size<Zivid::FrameInfo::SoftwareVersion>::value,
"Index must be less than 1");
757 = decltype(declval<Zivid::FrameInfo::SoftwareVersion>().get<i>());
761 struct tuple_size<
Zivid::FrameInfo> : integral_constant<size_t, 2>
765 struct tuple_element<i,
Zivid::FrameInfo>
767 static_assert(i < tuple_size<Zivid::FrameInfo>::value,
"Index must be less than 2");
770 = decltype(declval<Zivid::FrameInfo>().get<i>());
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
Core version
Definition: FrameInfo.h:168
std::string toString() const
Get the value as string
bool operator!=(const Core &other) const
Comparison operator
Definition: FrameInfo.h:212
Core(std::string value)
Constructor
Definition: FrameInfo.h:195
friend std::ostream & operator<<(std::ostream &stream, const Core &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:230
const std::string & value() const
Get the value
bool operator==(const Core &other) const
Comparison operator
Definition: FrameInfo.h:206
Core()=default
Default constructor
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Core
Definition: FrameInfo.h:186
bool operator>(const Core &other) const
Comparison operator
Definition: FrameInfo.h:224
bool operator<(const Core &other) const
Comparison operator
Definition: FrameInfo.h:218
std::string ValueType
The type of the underlying value
Definition: FrameInfo.h:183
The version information for installed software at the time of image capture
Definition: FrameInfo.h:150
SoftwareVersion & set(const Core &value)
Set Core
Definition: FrameInfo.h:356
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:384
SoftwareVersion()
Default constructor
const FrameInfo::SoftwareVersion::Core & get() const
Definition: FrameInfo.h:364
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:326
const Core & core() const
Get Core
Definition: FrameInfo.h:344
SoftwareVersion(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:269
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:377
Core & core()
Get Core
Definition: FrameInfo.h:350
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:295
friend std::ostream & operator<<(std::ostream &stream, const SoftwareVersion &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:399
std::tuple< FrameInfo::SoftwareVersion::Core > Descendants
Definition: FrameInfo.h:243
std::string toString() const
Get the value as string
The time of frame capture
Definition: FrameInfo.h:418
std::chrono::system_clock::time_point value() const
Get the value
bool operator>(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:474
bool operator<(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:468
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:445
bool operator!=(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:462
friend std::ostream & operator<<(std::ostream &stream, const TimeStamp &value)
Operator to serialize the value to a stream
Definition: FrameInfo.h:480
bool operator==(const TimeStamp &other) const
Comparison operator
Definition: FrameInfo.h:456
static constexpr Range< std::chrono::system_clock::time_point > validRange()
The range of valid values for TimeStamp
Definition: FrameInfo.h:436
std::chrono::system_clock::time_point ValueType
The type of the underlying value
Definition: FrameInfo.h:433
Various information for a frame
Definition: FrameInfo.h:120
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:681
FrameInfo()
Default constructor
FrameInfo & set(const SoftwareVersion::Core &value)
Set SoftwareVersion::Core
Definition: FrameInfo.h:623
void set(Args &&...args)
Set multiple arguments
Definition: FrameInfo.h:553
void save(const std::string &fileName) const
Save to the given file
const TimeStamp & timeStamp() const
Get TimeStamp
Definition: FrameInfo.h:630
SoftwareVersion & softwareVersion()
Get SoftwareVersion
Definition: FrameInfo.h:610
FrameInfo(const std::string &fileName)
Construct FrameInfo by loading from file
const FrameInfo::SoftwareVersion::Core & get() const
Definition: FrameInfo.h:656
FrameInfo(Args &&...args)
Constructor taking variadic number of arguments
Definition: FrameInfo.h:525
const FrameInfo::TimeStamp & get() const
Definition: FrameInfo.h:662
const SoftwareVersion & softwareVersion() const
Get SoftwareVersion
Definition: FrameInfo.h:604
friend std::ostream & operator<<(std::ostream &stream, const FrameInfo &value)
Operator to send the value as string to a stream
Definition: FrameInfo.h:705
TimeStamp & timeStamp()
Get TimeStamp
Definition: FrameInfo.h:636
const FrameInfo::SoftwareVersion & get() const
Definition: FrameInfo.h:649
FrameInfo & set(const SoftwareVersion &value)
Set SoftwareVersion
Definition: FrameInfo.h:616
FrameInfo & set(const TimeStamp &value)
Set TimeStamp
Definition: FrameInfo.h:642
bool operator!=(const FrameInfo &other) const
Inequality operator
std::tuple< FrameInfo::SoftwareVersion, FrameInfo::SoftwareVersion::Core, FrameInfo::TimeStamp > Descendants
Definition: FrameInfo.h:494
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: FrameInfo.h:689
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:586
Class describing a range of values for a given type T
Definition: Range.h:102
NodeType
Definition: NodeType.h:100
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99