Zivid C++ API 2.13.1+18e79e79-1
Zivid::CameraState Class Reference

Information about camera connection state, temperatures, etc. More...

#include <Zivid/CameraState.h>

Classes

class  Available
 Flag if camera is physically connected to the computer and is available for use, but not connected in software. This corresponds to the Status enums available or firmwareUpdateRequired. Zivid recommends to use the Status enum instead of this bool. More...
 
class  Connected
 Flag if camera is connected in software. This bool is true when the Status value is connected. Zivid recommends to use the Status enum instead of this bool. More...
 
class  InaccessibleReason
 If the camera status is inaccessible, then this enum value will give you the reason. More...
 
class  Network
 Current network state. More...
 
class  Status
 This enum describes the current status of this camera. The enum can have the following values: More...
 
class  Temperature
 Current temperature(s) More...
 

Public Types

using Descendants
 

Public Member Functions

 CameraState ()
 Default constructor.
 
 CameraState (const std::string &fileName)
 Construct CameraState by loading from file.
 
std::string serialize () const
 Serialize to a string.
 
template<typename... Args>
 CameraState (Args &&...args)
 Constructor taking variadic number of arguments.
 
template<typename... Args>
void set (Args &&...args)
 Set multiple arguments.
 
template<typename... Args>
CameraState copyWith (Args &&...args) const
 Returns a copy of this object with the given argument(s) set to the new value(s)
 
const AvailableisAvailable () const
 Get Available.
 
AvailableisAvailable ()
 Get Available.
 
CameraStateset (const Available &value)
 Set Available.
 
const ConnectedisConnected () const
 Get Connected.
 
ConnectedisConnected ()
 Get Connected.
 
CameraStateset (const Connected &value)
 Set Connected.
 
const InaccessibleReasoninaccessibleReason () const
 Get InaccessibleReason.
 
InaccessibleReasoninaccessibleReason ()
 Get InaccessibleReason.
 
CameraStateset (const InaccessibleReason &value)
 Set InaccessibleReason.
 
const Networknetwork () const
 Get Network.
 
Networknetwork ()
 Get Network.
 
CameraStateset (const Network &value)
 Set Network.
 
CameraStateset (const Network::IPV4 &value)
 Set Network::IPV4.
 
CameraStateset (const Network::IPV4::Address &value)
 Set Network::IPV4::Address.
 
const Statusstatus () const
 Get Status.
 
Statusstatus ()
 Get Status.
 
CameraStateset (const Status &value)
 Set Status.
 
const Temperaturetemperature () const
 Get Temperature.
 
Temperaturetemperature ()
 Get Temperature.
 
CameraStateset (const Temperature &value)
 Set Temperature.
 
CameraStateset (const Temperature::DMD &value)
 Set Temperature::DMD.
 
CameraStateset (const Temperature::General &value)
 Set Temperature::General.
 
CameraStateset (const Temperature::LED &value)
 Set Temperature::LED.
 
CameraStateset (const Temperature::Lens &value)
 Set Temperature::Lens.
 
CameraStateset (const Temperature::PCB &value)
 Set Temperature::PCB.
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Available >::value, int >::type = 0>
const CameraState::Availableget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Connected >::value, int >::type = 0>
const CameraState::Connectedget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::InaccessibleReason >::value, int >::type = 0>
const CameraState::InaccessibleReasonget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Network >::value, int >::type = 0>
const CameraState::Networkget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Network::IPV4 >::value, int >::type = 0>
const CameraState::Network::IPV4get () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Network::IPV4::Address >::value, int >::type = 0>
const CameraState::Network::IPV4::Addressget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Status >::value, int >::type = 0>
const CameraState::Statusget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature >::value, int >::type = 0>
const CameraState::Temperatureget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::DMD >::value, int >::type = 0>
const CameraState::Temperature::DMDget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::General >::value, int >::type = 0>
const CameraState::Temperature::Generalget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::LED >::value, int >::type = 0>
const CameraState::Temperature::LEDget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::Lens >::value, int >::type = 0>
const CameraState::Temperature::Lensget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::PCB >::value, int >::type = 0>
const CameraState::Temperature::PCBget () const
 
template<size_t i, typename std::enable_if< i==0, int >::type = 0>
const CameraState::Availableget () const
 
template<size_t i, typename std::enable_if< i==1, int >::type = 0>
const CameraState::Connectedget () const
 
template<size_t i, typename std::enable_if< i==2, int >::type = 0>
const CameraState::InaccessibleReasonget () const
 
template<size_t i, typename std::enable_if< i==3, int >::type = 0>
const CameraState::Networkget () const
 
template<size_t i, typename std::enable_if< i==4, int >::type = 0>
const CameraState::Statusget () const
 
template<size_t i, typename std::enable_if< i==5, int >::type = 0>
const CameraState::Temperatureget () const
 
template<typename F >
void forEach (const F &f) const
 Run the given function on each direct member with the value of the member as parameter.
 
template<typename F >
void forEach (const F &f)
 Run the given function on each direct member with the value of the member as parameter.
 
bool operator== (const CameraState &other) const
 Equality operator.
 
bool operator!= (const CameraState &other) const
 Inequality operator.
 
std::string toString () const
 Get the value as string.
 
void save (const std::string &fileName) const
 Save to the given file.
 
void load (const std::string &fileName)
 Load from the given file.
 

Static Public Member Functions

static ZIVID_NODISCARD CameraState fromSerialized (const std::string &value)
 Construct a new CameraState instance from a previously serialized string.
 

Static Public Attributes

static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group
 The type of this node.
 
static constexpr const char * path { "" }
 The full path for this value.
 
static constexpr const char * name { "CameraState" }
 The name of this value.
 
static constexpr const char * description
 The description for this value.
 
static constexpr size_t version { 6 }
 

Friends

struct DataModel::Detail::Befriend< CameraState >
 
std::ostream & operator<< (std::ostream &stream, const CameraState &value)
 Operator to send the value as string to a stream.
 

Detailed Description

Information about camera connection state, temperatures, etc.

Member Typedef Documentation

◆ Descendants

Initial value:
std::tuple<
CameraState::Available,
CameraState::Connected,
CameraState::InaccessibleReason,
CameraState::Network,
CameraState::Network::IPV4,
CameraState::Network::IPV4::Address,
CameraState::Status,
CameraState::Temperature,
CameraState::Temperature::DMD,
CameraState::Temperature::General,
CameraState::Temperature::LED,
CameraState::Temperature::Lens,
CameraState::Temperature::PCB>

Constructor & Destructor Documentation

◆ CameraState() [1/3]

Zivid::CameraState::CameraState ( )

Default constructor.

◆ CameraState() [2/3]

Zivid::CameraState::CameraState ( const std::string & fileName)
explicit

Construct CameraState by loading from file.

◆ CameraState() [3/3]

template<typename... Args>
Zivid::CameraState::CameraState ( Args &&... args)
inlineexplicit

Constructor taking variadic number of arguments.

One or more descendant types can be provided. All types not provided will be set to their default value. The result is the same as default constructing CameraState then invoking set(args).

The provided arguments must be descendants of CameraState. These types can be provided:

Member Function Documentation

◆ copyWith()

template<typename... Args>
CameraState Zivid::CameraState::copyWith ( Args &&... args) const
inline

Returns a copy of this object with the given argument(s) set to the new value(s)

Creates a copy of this CameraState object, then invokes set(args) on the copy, and finally returns the copy. This method does not modify the original object.

The provided arguments must be descendants of CameraState. These types can be provided:

◆ forEach() [1/2]

template<typename F >
void Zivid::CameraState::forEach ( const F & f)
inline

Run the given function on each direct member with the value of the member as parameter.

◆ forEach() [2/2]

template<typename F >
void Zivid::CameraState::forEach ( const F & f) const
inline

Run the given function on each direct member with the value of the member as parameter.

◆ fromSerialized()

static ZIVID_NODISCARD CameraState Zivid::CameraState::fromSerialized ( const std::string & value)
static

Construct a new CameraState instance from a previously serialized string.

See also serialize.

◆ get() [1/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Available >::value, int >::type = 0>
const CameraState::Available & Zivid::CameraState::get ( ) const
inline

◆ get() [2/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Connected >::value, int >::type = 0>
const CameraState::Connected & Zivid::CameraState::get ( ) const
inline

◆ get() [3/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::InaccessibleReason >::value, int >::type = 0>
const CameraState::InaccessibleReason & Zivid::CameraState::get ( ) const
inline

◆ get() [4/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Network >::value, int >::type = 0>
const CameraState::Network & Zivid::CameraState::get ( ) const
inline

◆ get() [5/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Network::IPV4 >::value, int >::type = 0>
const CameraState::Network::IPV4 & Zivid::CameraState::get ( ) const
inline

◆ get() [6/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Network::IPV4::Address >::value, int >::type = 0>
const CameraState::Network::IPV4::Address & Zivid::CameraState::get ( ) const
inline

◆ get() [7/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Status >::value, int >::type = 0>
const CameraState::Status & Zivid::CameraState::get ( ) const
inline

◆ get() [8/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature >::value, int >::type = 0>
const CameraState::Temperature & Zivid::CameraState::get ( ) const
inline

◆ get() [9/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::DMD >::value, int >::type = 0>
const CameraState::Temperature::DMD & Zivid::CameraState::get ( ) const
inline

◆ get() [10/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::General >::value, int >::type = 0>
const CameraState::Temperature::General & Zivid::CameraState::get ( ) const
inline

◆ get() [11/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::LED >::value, int >::type = 0>
const CameraState::Temperature::LED & Zivid::CameraState::get ( ) const
inline

◆ get() [12/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::Lens >::value, int >::type = 0>
const CameraState::Temperature::Lens & Zivid::CameraState::get ( ) const
inline

◆ get() [13/19]

template<typename T , typename std::enable_if< std::is_same< T, CameraState::Temperature::PCB >::value, int >::type = 0>
const CameraState::Temperature::PCB & Zivid::CameraState::get ( ) const
inline

◆ get() [14/19]

template<size_t i, typename std::enable_if< i==0, int >::type = 0>
const CameraState::Available & Zivid::CameraState::get ( ) const
inline

◆ get() [15/19]

template<size_t i, typename std::enable_if< i==1, int >::type = 0>
const CameraState::Connected & Zivid::CameraState::get ( ) const
inline

◆ get() [16/19]

template<size_t i, typename std::enable_if< i==2, int >::type = 0>
const CameraState::InaccessibleReason & Zivid::CameraState::get ( ) const
inline

◆ get() [17/19]

template<size_t i, typename std::enable_if< i==3, int >::type = 0>
const CameraState::Network & Zivid::CameraState::get ( ) const
inline

◆ get() [18/19]

template<size_t i, typename std::enable_if< i==4, int >::type = 0>
const CameraState::Status & Zivid::CameraState::get ( ) const
inline

◆ get() [19/19]

template<size_t i, typename std::enable_if< i==5, int >::type = 0>
const CameraState::Temperature & Zivid::CameraState::get ( ) const
inline

◆ inaccessibleReason() [1/2]

InaccessibleReason & Zivid::CameraState::inaccessibleReason ( )
inline

◆ inaccessibleReason() [2/2]

const InaccessibleReason & Zivid::CameraState::inaccessibleReason ( ) const
inline

◆ isAvailable() [1/2]

Available & Zivid::CameraState::isAvailable ( )
inline

Get Available.

◆ isAvailable() [2/2]

const Available & Zivid::CameraState::isAvailable ( ) const
inline

Get Available.

◆ isConnected() [1/2]

Connected & Zivid::CameraState::isConnected ( )
inline

Get Connected.

◆ isConnected() [2/2]

const Connected & Zivid::CameraState::isConnected ( ) const
inline

Get Connected.

◆ load()

void Zivid::CameraState::load ( const std::string & fileName)

Load from the given file.

◆ network() [1/2]

Network & Zivid::CameraState::network ( )
inline

Get Network.

◆ network() [2/2]

const Network & Zivid::CameraState::network ( ) const
inline

Get Network.

◆ operator!=()

bool Zivid::CameraState::operator!= ( const CameraState & other) const

Inequality operator.

◆ operator==()

bool Zivid::CameraState::operator== ( const CameraState & other) const

Equality operator.

◆ save()

void Zivid::CameraState::save ( const std::string & fileName) const

Save to the given file.

◆ serialize()

std::string Zivid::CameraState::serialize ( ) const

Serialize to a string.

See also fromSerialized. The returned string is formatted in YAML, and is compatible with the contents of files saved using save.

◆ set() [1/14]

template<typename... Args>
void Zivid::CameraState::set ( Args &&... args)
inline

◆ set() [2/14]

CameraState & Zivid::CameraState::set ( const Available & value)
inline

Set Available.

◆ set() [3/14]

CameraState & Zivid::CameraState::set ( const Connected & value)
inline

Set Connected.

◆ set() [4/14]

CameraState & Zivid::CameraState::set ( const InaccessibleReason & value)
inline

◆ set() [5/14]

CameraState & Zivid::CameraState::set ( const Network & value)
inline

Set Network.

◆ set() [6/14]

CameraState & Zivid::CameraState::set ( const Network::IPV4 & value)
inline

◆ set() [7/14]

CameraState & Zivid::CameraState::set ( const Network::IPV4::Address & value)
inline

◆ set() [8/14]

CameraState & Zivid::CameraState::set ( const Status & value)
inline

Set Status.

◆ set() [9/14]

CameraState & Zivid::CameraState::set ( const Temperature & value)
inline

◆ set() [10/14]

CameraState & Zivid::CameraState::set ( const Temperature::DMD & value)
inline

◆ set() [11/14]

CameraState & Zivid::CameraState::set ( const Temperature::General & value)
inline

◆ set() [12/14]

CameraState & Zivid::CameraState::set ( const Temperature::LED & value)
inline

◆ set() [13/14]

CameraState & Zivid::CameraState::set ( const Temperature::Lens & value)
inline

◆ set() [14/14]

CameraState & Zivid::CameraState::set ( const Temperature::PCB & value)
inline

◆ status() [1/2]

Status & Zivid::CameraState::status ( )
inline

Get Status.

◆ status() [2/2]

const Status & Zivid::CameraState::status ( ) const
inline

Get Status.

◆ temperature() [1/2]

Temperature & Zivid::CameraState::temperature ( )
inline

◆ temperature() [2/2]

const Temperature & Zivid::CameraState::temperature ( ) const
inline

◆ toString()

std::string Zivid::CameraState::toString ( ) const

Get the value as string.

Friends And Related Symbol Documentation

◆ DataModel::Detail::Befriend< CameraState >

friend struct DataModel::Detail::Befriend< CameraState >
friend

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const CameraState & value )
friend

Operator to send the value as string to a stream.

Member Data Documentation

◆ description

const char* Zivid::CameraState::description
staticconstexpr
Initial value:
{
R"description(Information about camera connection state, temperatures, etc.)description"
}

The description for this value.

◆ name

const char* Zivid::CameraState::name { "CameraState" }
staticconstexpr

The name of this value.

◆ nodeType

DataModel::NodeType Zivid::CameraState::nodeType = DataModel::NodeType::group
staticconstexpr

The type of this node.

◆ path

const char* Zivid::CameraState::path { "" }
staticconstexpr

The full path for this value.

◆ version

size_t Zivid::CameraState::version { 6 }
staticconstexpr

The documentation for this class was generated from the following file: