Wheefun I/O Library  0.0.5
Useful I/O Primitives.
Public Types | Public Member Functions | Public Attributes | List of all members
wfio::DCntl Struct Reference

A command to be supplied to a device or similar stream. More...

#include <iotype.h>

Public Types

enum  Value {
  DCNTL_NOP, DCNTL_GETFD, DCNTL_SETFD, DCNTL_GETFLAGS,
  DCNTL_TRUNCATE
}
 An acceptable value for a DCntl. More...
 
typedef ::wfio_dcntl_t CType
 

Public Member Functions

 DCntl () throw ()
 Construct en empty DCntl.
 
 DCntl (Value value) throw ()
 Construct a DCntl from an explicit value.
 
 DCntl (CType value) throw ()
 Construct a DCntl from a CType.
 
bool operator== (DCntl rhs) const throw ()
 Compare this DCntl for equality. More...
 
bool operator!= (DCntl rhs) const throw ()
 Compare this DCntl for equality. More...
 
 operator CType () const throw ()
 Conver this DCntl to its CType. More...
 

Public Attributes

Value value
 The literal value of this DCntl.
 

Detailed Description

A command to be supplied to a device or similar stream.

These commands provide device-independent control of a stream. This is used to implement commands which can be shared between multiple devices.

Member Enumeration Documentation

◆ Value

An acceptable value for a DCntl.

Enumerator
DCNTL_NOP 
DCNTL_GETFD 

Obtain the file's current file descriptor.

Some devices are backed by a file descriptor backed by the operating system. When operating systemds support

Parameters
fdAn int* to hold the file descriptor.
DCNTL_SETFD 
DCNTL_GETFLAGS 

Obtain the flags associated with this device.

DCNTL_TRUNCATE 

Set the length of a device's backing store.

Some devices are backed by some form of persistent storage (such as a file) which admits being resized. When supported, this command shall attempt to resize the backing store to the length specified in the first argument (sz), which shall be of type size_t.

Parameters
szA size_t specifying the desired length of backing store.

Member Function Documentation

◆ operator CType()

wfio::DCntl::operator CType ( ) const
throw (
)
inline

Conver this DCntl to its CType.

The C representation of this object.

◆ operator!=()

bool wfio::DCntl::operator!= ( DCntl  rhs) const
throw (
)
inline

Compare this DCntl for equality.

Parameters
rhsThe DCntl to compare against.
Returns
Whether or not these DCntls are equal.

◆ operator==()

bool wfio::DCntl::operator== ( DCntl  rhs) const
throw (
)
inline

Compare this DCntl for equality.

Parameters
rhsThe DCntl to compare against.
Returns
Whether or not these DCntls are equal.

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