Zivid C++ API 2.19.0+b5c53d0f-1
Zivid::NetworkConfiguration Class Reference

Network configuration of a camera. More...

#include <Zivid/NetworkConfiguration.h>

Classes

class  Hostname
 Configure the camera's hostname. If unset, the camera will use the default hostname based on the serial number: zivid-<serial>. Note that fetchNetworkConfig will not return the default hostname in this field. If the camera is using the default hostname, then this field will be unset. Use CameraState/Network/Hostname instead, which returns the camera's current hostname. More...
class  IPV4
 IPv4 network configuration. More...

Public Types

using Descendants

Public Member Functions

 NetworkConfiguration ()
 Default constructor.
 NetworkConfiguration (const std::string &fileName)
 Construct NetworkConfiguration by loading from file.
std::string serialize () const
 Serialize to a string.
template<typename... Args>
 NetworkConfiguration (Args &&...args)
 Constructor taking variadic number of arguments.
template<typename... Args>
void set (Args &&...args)
 Set multiple arguments.
template<typename... Args>
NetworkConfiguration copyWith (Args &&...args) const
 Returns a copy of this object with the given argument(s) set to the new value(s)
const Hostname & hostname () const
 Get Hostname.
Hostname & hostname ()
 Get Hostname.
NetworkConfiguration & set (const Hostname &value)
 Set Hostname.
const IPV4 & ipv4 () const
 Get IPV4.
IPV4 & ipv4 ()
 Get IPV4.
NetworkConfiguration & set (const IPV4 &value)
 Set IPV4.
NetworkConfiguration & set (const IPV4::Address &value)
 Set IPV4::Address.
NetworkConfiguration & set (const IPV4::Mode &value)
 Set IPV4::Mode.
NetworkConfiguration & set (const IPV4::SubnetMask &value)
 Set IPV4::SubnetMask.
template<typename T, typename std::enable_if< std::is_same< T, NetworkConfiguration::Hostname >::value, int >::type = 0>
const NetworkConfiguration::Hostname & get () const
template<typename T, typename std::enable_if< std::is_same< T, NetworkConfiguration::IPV4 >::value, int >::type = 0>
const NetworkConfiguration::IPV4 & get () const
template<typename T, typename std::enable_if< std::is_same< T, NetworkConfiguration::IPV4::Address >::value, int >::type = 0>
const NetworkConfiguration::IPV4::Address & get () const
template<typename T, typename std::enable_if< std::is_same< T, NetworkConfiguration::IPV4::Mode >::value, int >::type = 0>
const NetworkConfiguration::IPV4::Mode & get () const
template<typename T, typename std::enable_if< std::is_same< T, NetworkConfiguration::IPV4::SubnetMask >::value, int >::type = 0>
const NetworkConfiguration::IPV4::SubnetMask & get () const
template<size_t i, typename std::enable_if< i==0, int >::type = 0>
const NetworkConfiguration::Hostname & get () const
template<size_t i, typename std::enable_if< i==1, int >::type = 0>
const NetworkConfiguration::IPV4 & get () 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 NetworkConfiguration &other) const
 Equality operator.
bool operator!= (const NetworkConfiguration &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 NetworkConfiguration fromSerialized (const std::string &value)
 Construct a new NetworkConfiguration 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 { "NetworkConfiguration" }
 The name of this value.
static constexpr const char * description
 The description for this value.
static constexpr size_t version { 2 }

Friends

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

Detailed Description

Network configuration of a camera.

Member Typedef Documentation

◆ Descendants

Initial value:
std::tuple<
Configure the camera's hostname. If unset, the camera will use the default hostname based on the seri...
Definition NetworkConfiguration.h:121
The camera's IPv4 address. Only used in manual mode.
Definition NetworkConfiguration.h:256
DHCP or manual configuration.
Definition NetworkConfiguration.h:355
The camera's subnet mask (for example 255.255.255.0). Only used in manual mode.
Definition NetworkConfiguration.h:448
IPv4 network configuration.
Definition NetworkConfiguration.h:234

Constructor & Destructor Documentation

◆ NetworkConfiguration() [1/3]

Zivid::NetworkConfiguration::NetworkConfiguration ( )

Default constructor.

◆ NetworkConfiguration() [2/3]

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

Construct NetworkConfiguration by loading from file.

◆ NetworkConfiguration() [3/3]

template<typename... Args>
Zivid::NetworkConfiguration::NetworkConfiguration ( 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 NetworkConfiguration then invoking set(args).

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

Member Function Documentation

◆ copyWith()

template<typename... Args>
NetworkConfiguration Zivid::NetworkConfiguration::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 NetworkConfiguration 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 NetworkConfiguration. These types can be provided:

◆ forEach() [1/2]

template<typename F>
void Zivid::NetworkConfiguration::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::NetworkConfiguration::forEach ( const F & f) const
inline

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

◆ fromSerialized()

NetworkConfiguration Zivid::NetworkConfiguration::fromSerialized ( const std::string & value)
staticnodiscard

Construct a new NetworkConfiguration instance from a previously serialized string.

See also serialize.

◆ get() [1/7]

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

◆ get() [2/7]

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

◆ get() [3/7]

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

◆ get() [4/7]

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

◆ get() [5/7]

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

◆ get() [6/7]

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

◆ get() [7/7]

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

◆ hostname() [1/2]

Hostname & Zivid::NetworkConfiguration::hostname ( )
inline

Get Hostname.

◆ hostname() [2/2]

const Hostname & Zivid::NetworkConfiguration::hostname ( ) const
inline

Get Hostname.

◆ ipv4() [1/2]

IPV4 & Zivid::NetworkConfiguration::ipv4 ( )
inline

Get IPV4.

◆ ipv4() [2/2]

const IPV4 & Zivid::NetworkConfiguration::ipv4 ( ) const
inline

Get IPV4.

◆ load()

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

Load from the given file.

◆ operator!=()

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

Inequality operator.

◆ operator==()

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

Equality operator.

◆ save()

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

Save to the given file.

◆ serialize()

std::string Zivid::NetworkConfiguration::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/6]

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

Set multiple arguments.

The method invokes set(arg) with each of the provided arguments.

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

◆ set() [2/6]

NetworkConfiguration & Zivid::NetworkConfiguration::set ( const Hostname & value)
inline

Set Hostname.

◆ set() [3/6]

NetworkConfiguration & Zivid::NetworkConfiguration::set ( const IPV4 & value)
inline

Set IPV4.

◆ set() [4/6]

NetworkConfiguration & Zivid::NetworkConfiguration::set ( const IPV4::Address & value)
inline

◆ set() [5/6]

NetworkConfiguration & Zivid::NetworkConfiguration::set ( const IPV4::Mode & value)
inline

Set IPV4::Mode.

◆ set() [6/6]

NetworkConfiguration & Zivid::NetworkConfiguration::set ( const IPV4::SubnetMask & value)
inline

◆ toString()

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

Get the value as string.

◆ DataModel::Detail::Befriend< NetworkConfiguration >

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

◆ operator<<

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

Operator to send the value as string to a stream.

Member Data Documentation

◆ description

const char* Zivid::NetworkConfiguration::description
staticconstexpr
Initial value:
{ R"description(Network configuration of a camera
)description" }

The description for this value.

◆ name

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

The name of this value.

◆ nodeType

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

The type of this node.

◆ path

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

The full path for this value.

◆ version

size_t Zivid::NetworkConfiguration::version { 2 }
staticconstexpr

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