Skip to content

Pylon::AccessModeSet#

Module: Transport Layer

Collection of access mode bits. More…

#include <pylon/DeviceAccessMode.h>

Public Functions#

Name
AccessModeSet(void )
Default constructor creates an empty set.
AccessModeSet(EDeviceAccessMode am)
Converts an access mode into a set.
AccessModeSet(const AccessModeSet & ams)
Copy constructor.
AccessModeSet & set(size_t pos)
Sets the bit at position pos.
AccessModeSet & reset()
Resets all bits to zero.
bool any() const
Returns whether any of the bits is set (i.e., whether at least one bit in the AccessModeSet is set to one).
bool none() const
Returns whether any of the bits is set (i.e., whether at least one bit in the AccessModeSet is set to one).
bool test(size_t pos) const
Returns whether the bit at position pos is set (i.e., whether it is one).
unsigned long to_ulong() const
Returns an unsigned long with the integer value that has the same bits set as the AccessModeSet.

Detailed Description#

class Pylon::AccessModeSet;

Collection of access mode bits.

See:

Low Level API:

This set is used when a device is opened. The combination of different access modes specifies how the device is opened. Not all combinations may be allowed because the device implementations have certain restrictions.

Used for defining how a device is accessed.

AccessModeSet a = Exclusive | Stream;
if (a.test( Exclusive ))
{
    // Exclusive implies Control access, so set it also
    a |= Control;
}

Public Functions Documentation#

function AccessModeSet#

AccessModeSet(
    void
)

Default constructor creates an empty set.

function AccessModeSet#

AccessModeSet(
    EDeviceAccessMode am
)

Converts an access mode into a set.

function AccessModeSet#

AccessModeSet(
    const AccessModeSet & ams
)

Copy constructor.

function set#

AccessModeSet & set(
    size_t pos
)

Sets the bit at position pos.

Parameters:

  • pos Order position of the bit whose value is modified. Order positions are counted from the rightmost bit, which is order position 0.

Return: *this

function reset#

AccessModeSet & reset()

Resets all bits to zero.

Return: *this

function any#

bool any() const

Returns whether any of the bits is set (i.e., whether at least one bit in the AccessModeSet is set to one).

Return: true if any of the bits in the AccessModeSet is set (to one), and false otherwise.

function none#

bool none() const

Returns whether any of the bits is set (i.e., whether at least one bit in the AccessModeSet is set to one).

Return: true if any of the bits in the AccessModeSet is set (to one), and false otherwise.

function test#

bool test(
    size_t pos
) const

Returns whether the bit at position pos is set (i.e., whether it is one).

Parameters:

  • pos Order position of the bit whose value is modified. Order positions are counted from the rightmost bit, which is order position 0.

Return: true if the bit at position pos is set, and false if it is not set.

function to_ulong#

unsigned long to_ulong() const

Returns an unsigned long with the integer value that has the same bits set as the AccessModeSet.

Return: Integer value with the same bit representation as the AccessModeSet object.