libptpmgmt  1.4
libptpmgmt library that provides the functionality of linuxptp pmc
Public Member Functions | List of all members
SigDelay Class Reference

#include <vecDef.h>

Public Member Functions

 SigDelay ()
 
 SigDelay (size_t size)
 
 SigDelay (size_t size, const SLAVE_DELAY_TIMING_DATA_NP_rec_t &value)
 
 SigDelay (const SigDelay &container)
 
size_t size () const
 
bool empty () const
 
void clear ()
 
void push (const SLAVE_DELAY_TIMING_DATA_NP_rec_t &value)
 
SLAVE_DELAY_TIMING_DATA_NP_rec_t pop ()
 
void pop_back ()
 
SLAVE_DELAY_TIMING_DATA_NP_rec_t back ()
 
SLAVE_DELAY_TIMING_DATA_NP_rec_t front ()
 
SLAVE_DELAY_TIMING_DATA_NP_rec_tget (size_t position) const
 
void set (size_t position, SLAVE_DELAY_TIMING_DATA_NP_rec_t &value)
 
SLAVE_DELAY_TIMING_DATA_NP_rec_toperator[] (size_t position)
 
size_t capacity () const
 
void reserve (size_t new_cap)
 
size_t max_size () const
 

Detailed Description

class to handle std::vector<SLAVE_DELAY_TIMING_DATA_NP_rec_t> in scripts

Constructor & Destructor Documentation

◆ SigDelay() [1/4]

SigDelay::SigDelay ( )

Initiate a new empty container

Note
Go do not use constructor and destructors, call
NewSigDelay()
and
DeleteSigDelay()
explicitly.

◆ SigDelay() [2/4]

SigDelay::SigDelay ( size_t  size)

Initiate a new container with size elements

Parameters
[in]sizeof the new container
Note
Elements holds default value!
Go do not use constructor and destructors, call
NewSigDelay(int64(size))
size_t size() const
and
DeleteSigDelay()
explicitly.

◆ SigDelay() [3/4]

SigDelay::SigDelay ( size_t  size,
const SLAVE_DELAY_TIMING_DATA_NP_rec_t value 
)

Initiate a new container with size elements and copy value to all elements

Parameters
[in]sizeof the new container
[in]valuefor all elements in new container
Note
This constructor is not available in PHP and in Go.

◆ SigDelay() [4/4]

SigDelay::SigDelay ( const SigDelay container)

Copy constructor

Parameters
[in]containerto copy
Note
Go do not use constructor and destructors, call
NewSigDelay(container)
and
DeleteSigDelay()
explicitly.

Member Function Documentation

◆ back()

Get last element from container

Attention
initiate exception if container is empty!
Note
This function available in Python, Ruby and Lua.

◆ capacity()

size_t SigDelay::capacity ( ) const

Get current container capacity

Note
This function available in Python, Ruby, PHP and Go.
The function is named
Capacity()
in Go.

◆ clear()

void SigDelay::clear ( )

Remove all elements from container

Note
Call std::vector<SLAVE_DELAY_TIMING_DATA_NP_rec_t>::clear()
The function is named
Clear()
in Go.

◆ empty()

bool SigDelay::empty ( ) const

Query if container is empty

Returns
true if size is zero
Note
The function is named
is_empty()
in PHP,
bool empty() const
in Ruby. and
IsEmpty()
in Go.

◆ front()

SLAVE_DELAY_TIMING_DATA_NP_rec_t SigDelay::front ( )

Get first element from container

Attention
initiate exception if container is empty!
Note
This function available in Python, Ruby and Lua.

◆ get()

SLAVE_DELAY_TIMING_DATA_NP_rec_t& SigDelay::get ( size_t  position) const

Get element from the container

Parameters
[in]positionof element to get
Returns
the element
Attention
initiate exception if out of range!
Note
This function is available in Perl, Tcl and PHP. Ruby, Python and Lua use operator[].
The function is named
Get()
in Go.

◆ max_size()

size_t SigDelay::max_size ( ) const

Get system limitation to container size

Note
This function available in Lua only.

◆ operator[]()

SLAVE_DELAY_TIMING_DATA_NP_rec_t& SigDelay::operator[] ( size_t  position)

Fetch an element from the container The operator can be used for retrieving and setting!

Parameters
[in]positionof the element
Returns
the element
Attention
initiate exception if out of range!
Note
This function is available for Ruby, Python and Lua. Perl, Tcl and PHP should use
get(), set()
void set(size_t position, SLAVE_DELAY_TIMING_DATA_NP_rec_t &value)
SLAVE_DELAY_TIMING_DATA_NP_rec_t & get(size_t position) const
. Go use
Get(), Set()
.
To set use
variable[index] = new_value

◆ pop()

Get last element and removes it from the container

Returns
last element
Attention
initiate exception if container is empty!
Note
Call std::vector<SLAVE_DELAY_TIMING_DATA_NP_rec_t>::back() and std::vector<SLAVE_DELAY_TIMING_DATA_NP_rec_t>::pop_back()
This function is not available in Lua and Go. Lua have the 'back()' and 'pop_back()' functions.

◆ pop_back()

void SigDelay::pop_back ( )

Removes last element from the container

Attention
initiate exception if container is empty!
Note
This function available in Python and Lua only.

◆ push()

void SigDelay::push ( const SLAVE_DELAY_TIMING_DATA_NP_rec_t value)

Push a copy of element at the end of the container

Parameters
[in]valueto push
Note
Call std::vector<SLAVE_DELAY_TIMING_DATA_NP_rec_t>::push_back()
The function is named
push_back()
in Python and Lua, and
Add()
in Go.

◆ reserve()

void SigDelay::reserve ( size_t  new_cap)

Reserve more space for further elements

Note
This function available in Python, Ruby, PHP and Go.
The function is named
Reserve()
in Go.

◆ set()

void SigDelay::set ( size_t  position,
SLAVE_DELAY_TIMING_DATA_NP_rec_t value 
)

Replace element value in the container

Parameters
[in]positionof element to set
[in]valueelement with new value
Attention
initiate exception if out of range!
Note
This function is available in Perl, Tcl, PHP and Go. Ruby, Python and Lua use operator[].
The function is named
Set()
in Go.

◆ size()

size_t SigDelay::size ( ) const

Get the number of elements in container

Returns
number of elements in container
Note
The function is named
Size()
in Go.

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