CVB++ 14.0
Server Class Reference

Common Vision Blox GigE Vision Server implements a GigE Vision camera in software. More...

#include <cvb/gevserver/server.hpp>

Inherits enable_shared_from_this< Server >.

Public Member Functions

void * Handle () const noexcept
 Classic API device handle. More...
 
GevServer::State State ()
 Gets the the current state this server is in.
 
GevServer::DriverType DriverType ()
 Gets the GigE Vision driver used by this server object.
 
String UserVersion () const
 Gets the user defined version that is appended to the device version. More...
 
void SetUserVersion (const String &value)
 Sets the user defined version that is appended to the device version. More...
 
Cvb::NetworkConnection LocalEndpoint () const
 Gets the local end point this server is bound to. More...
 
Cvb::NetworkConnection RemoteEndpoint () const
 Gets the remote end point this server is connected to. More...
 
NodeMapPtr NodeMap () const
 Gets this servers node map.
 
StreamPtr Stream () const
 Gets the Cvb::GevServer::Stream for sending Images or other data. More...
 
void Start (const Cvb::NetworkConnection::IPAddress &address)
 Starts this server and binds it to the given address . More...
 
void Start (const Cvb::NetworkConnection::IPAddressUInt &address)
 Starts this server and binds it to the given address . More...
 
void Stop ()
 Stops this server. More...
 

Static Public Member Functions

static ServerPtr CreateNonStreaming ()
 Creates a non-streaming GigE Vision server object. More...
 
static ServerPtr CreateWithConstSize (Size2D< int > size, PfncFormat pixelFormat, GevServer::DriverType driverType=GevServer::DriverType::Auto)
 Creates a new Server object with a constant width and height. More...
 
static ServerPtr CreateWithConstSize (Size2D< int > size, ColorModel colorModel, DataType dataType, GevServer::DriverType driverType=GevServer::DriverType::Auto)
 Creates a new Server object with a constant width and height. More...
 
static ServerPtr CreateWithVariableSize (Size2D< int > maxSize, ColorModel colorModel, DataType dataType, GevServer::DriverType driverType=GevServer::DriverType::Auto)
 Creates a new Server object with a client configurable width, height and offsets. More...
 
static ServerPtr CreateWithVariableSize (Size2D< int > maxSize, PfncFormat pixelFormat, GevServer::DriverType driverType=GevServer::DriverType::Auto)
 Creates a new Server object with a client configurable width, height and offsets. More...
 

Detailed Description

Common Vision Blox GigE Vision Server implements a GigE Vision camera in software.

Member Function Documentation

◆ CreateNonStreaming()

ServerPtr CreateNonStreaming ( )
inlinestatic

Creates a non-streaming GigE Vision server object.

For stream-capable variants see CreateWithConstSize(Size2D, ColorModel, DataType, DriverType) or CreateWithVariableSize(Size2D, ColorModel, DataType, DriverType).

You can use this server for pure communication use cases via the GenApi (think e.g. of a lighting controller or motor lens).

◆ CreateWithConstSize() [1/2]

ServerPtr CreateWithConstSize ( Size2D< int >  size,
ColorModel  colorModel,
DataType  dataType,
GevServer::DriverType  driverType = GevServer::DriverType::Auto 
)
inlinestatic

Creates a new Server object with a constant width and height.

Tries to map the given colorModel and dataType to a PfncFormat.

If you wish to change the payload size (e.g. because you want to send chunk data), you can set it on the "PayloadSizeValue" node in State::Configuration State.

Parameters
sizeWidth and height in pixels.
colorModelColor model of the image to send.
dataTypeCVB data type of the image to send.
driverTypeThe DriverType to use.
Returns
Newly created server object in State::Configuration state.

◆ CreateWithConstSize() [2/2]

ServerPtr CreateWithConstSize ( Size2D< int >  size,
PfncFormat  pixelFormat,
GevServer::DriverType  driverType = GevServer::DriverType::Auto 
)
inlinestatic

Creates a new Server object with a constant width and height.

If you wish to change the payload size (e.g. because you want to send chunk data), you can set it on the "PayloadSizeValue" node in State::Configuration State.

Parameters
sizeWidth and height in pixels.
pixelFormatGenICam PFNC format value.
driverTypeThe DriverType to use.
Returns
Newly created server object in State::Configuration state.
Examples
GevServer/QmlGevServer.

◆ CreateWithVariableSize() [1/2]

ServerPtr CreateWithVariableSize ( Size2D< int >  maxSize,
ColorModel  colorModel,
DataType  dataType,
GevServer::DriverType  driverType = GevServer::DriverType::Auto 
)
inlinestatic

Creates a new Server object with a client configurable width, height and offsets.

Tries to map the given colorModel and dataType to a PfncFormat.

If you wish to change the payload size (e.g. because you want to send chunk data), you can set it on the "PayloadSizeValue" node in State::Configuration State.

Parameters
maxSizeMaximal width and height in pixels.
colorModelColor model of the image to send.
dataTypeCVB data type of the image to send.
driverTypeThe DriverType to use.
Returns
Newly created server object in State::Configuration state.

◆ CreateWithVariableSize() [2/2]

ServerPtr CreateWithVariableSize ( Size2D< int >  maxSize,
PfncFormat  pixelFormat,
GevServer::DriverType  driverType = GevServer::DriverType::Auto 
)
inlinestatic

Creates a new Server object with a client configurable width, height and offsets.

If you wish to change the payload size (e.g. because you want to send chunk data), you can set it on the "PayloadSizeValue" node in State::Configuration State.

Parameters
maxSizeMaximal width and height in pixels.
pixelFormatGenICam PFNC format value.
driverTypeThe DriverType to use.
Returns
Newly created server object in State::Configuration state.

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Classic API device handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ LocalEndpoint()

Cvb::NetworkConnection LocalEndpoint ( ) const
inline

Gets the local end point this server is bound to.

This value is only set if State is not State::Configuration.

NetworkConnection containing the current IPAddress and port.

◆ RemoteEndpoint()

Cvb::NetworkConnection RemoteEndpoint ( ) const
inline

Gets the remote end point this server is connected to.

This value is only set if State is State::Connected or State::AcquisitionEnabled.

NetworkConnection containing the current IPAddress and port. null if not connected.

◆ SetUserVersion()

void SetUserVersion ( const String value)
inline

Sets the user defined version that is appended to the device version.

This property is mandatory as soon as you change anything about the GenApi nodes! As the GenApi XML description is auto-generated the client needs a way to distinguish between different Server instances with differing feature sets.

If you change anything about the GenApi nodes on certain user version, you must increase the NodeMap::XmlFileVersion.

This version information is appended to the CVGevServer version. The available memory for the overall information is limited by the GigE Vision standard to 32 bytes which results in up to 31 ASCII characters text (actual encoding is UTF-8) as strings must be null-terminated. Longer version information is silently cropped!

◆ Start() [1/2]

void Start ( const Cvb::NetworkConnection::IPAddress address)
inline

Starts this server and binds it to the given address .

All communication channels are bound and the GenApi XML description is generated.

On success the state changes to State.Disconnected.

Parameters
addressIP address version 4 to bind to.

◆ Start() [2/2]

void Start ( const Cvb::NetworkConnection::IPAddressUInt address)
inline

Starts this server and binds it to the given address .

All communication channels are bound and the GenApi XML description is generated.

On success the state changes to State.Disconnected.

Parameters
addressIP address version 4 as unsigned integer to bind to.

◆ Stop()

void Stop ( )
inline

Stops this server.

Stopping the server results, depending on the current state, in a chain from State.AcquisitionEnabled to State::Connected to State::Disconnected to State::Configuration.

◆ Stream()

StreamPtr Stream ( ) const
inline

Gets the Cvb::GevServer::Stream for sending Images or other data.

This property is only non-null if you created the server object via CreateWithConstSize(Size2D, ColorModel, DataType, DriverType) or CreateWithVariableSize(Size2D, ColorModel, DataType, DriverType).

The Cvb::GevServer::Stream object if this server object is streaming capable; null for non-streaming server.

◆ UserVersion()

String UserVersion ( ) const
inline

Gets the user defined version that is appended to the device version.

This property is mandatory as soon as you change anything about the GenApi nodes! As the GenApi XML description is auto-generated the client needs a way to distinguish between different Server instances with differing feature sets.

If you change anything about the GenApi nodes on certain user version, you must increase the NodeMap::XmlFileVersion.

This version information is appended to the CVGevServer version. The available memory for the overall information is limited by the GigE Vision standard to 32 bytes which results in up to 31 ASCII characters text (actual encoding is UTF-8) as strings must be null-terminated. Longer version information is silently cropped!