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

#include <vecDef.h>

Public Member Functions

 AcceptableMaster_v ()
 
 AcceptableMaster_v (size_t size)
 
 AcceptableMaster_v (size_t size, const AcceptableMaster_t &value)
 
 AcceptableMaster_v (const AcceptableMaster_v &container)
 
size_t size () const
 
bool empty () const
 
void clear ()
 
void push (const AcceptableMaster_t &value)
 
AcceptableMaster_t pop ()
 
void pop_back ()
 
AcceptableMaster_t back ()
 
AcceptableMaster_t front ()
 
AcceptableMaster_tget (size_t position) const
 
void set (size_t position, AcceptableMaster_t &value)
 
AcceptableMaster_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<AcceptableMaster_t> in scripts

Constructor & Destructor Documentation

◆ AcceptableMaster_v() [1/4]

AcceptableMaster_v::AcceptableMaster_v ( )

Initiate a new empty container

Note
Go do not use constructor and destructors, call
NewAcceptableMaster_v()
and
DeleteAcceptableMaster_v()
explicitly.

◆ AcceptableMaster_v() [2/4]

AcceptableMaster_v::AcceptableMaster_v ( 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
NewAcceptableMaster_v(int64(size))
size_t size() const
and
DeleteAcceptableMaster_v()
explicitly.

◆ AcceptableMaster_v() [3/4]

AcceptableMaster_v::AcceptableMaster_v ( size_t  size,
const AcceptableMaster_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.

◆ AcceptableMaster_v() [4/4]

AcceptableMaster_v::AcceptableMaster_v ( const AcceptableMaster_v container)

Copy constructor

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

Member Function Documentation

◆ back()

AcceptableMaster_t AcceptableMaster_v::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 AcceptableMaster_v::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 AcceptableMaster_v::clear ( )

Remove all elements from container

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

◆ empty()

bool AcceptableMaster_v::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()

AcceptableMaster_t AcceptableMaster_v::front ( )

Get first element from container

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

◆ get()

AcceptableMaster_t& AcceptableMaster_v::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 AcceptableMaster_v::max_size ( ) const

Get system limitation to container size

Note
This function available in Lua only.

◆ operator[]()

AcceptableMaster_t& AcceptableMaster_v::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, AcceptableMaster_t &value)
AcceptableMaster_t & get(size_t position) const
. Go use
Get(), Set()
.
To set use
variable[index] = new_value

◆ pop()

AcceptableMaster_t AcceptableMaster_v::pop ( )

Get last element and removes it from the container

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

◆ pop_back()

void AcceptableMaster_v::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 AcceptableMaster_v::push ( const AcceptableMaster_t value)

Push a copy of element at the end of the container

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

◆ reserve()

void AcceptableMaster_v::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 AcceptableMaster_v::set ( size_t  position,
AcceptableMaster_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 AcceptableMaster_v::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: