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

#include <vecDef.h>

Public Member Functions

 PtpEvent_v ()
 
 PtpEvent_v (size_t size)
 
 PtpEvent_v (size_t size, const PtpEvent_t &value)
 
 PtpEvent_v (const PtpEvent_v &container)
 
size_t size () const
 
bool empty () const
 
void clear ()
 
void push (const PtpEvent_t &value)
 
PtpEvent_t pop ()
 
void pop_back ()
 
PtpEvent_t back ()
 
PtpEvent_t front ()
 
PtpEvent_tget (size_t position) const
 
void set (size_t position, PtpEvent_t &value)
 
PtpEvent_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<PtpEvent_t> in scripts

Constructor & Destructor Documentation

◆ PtpEvent_v() [1/4]

PtpEvent_v::PtpEvent_v ( )

Initiate a new empty container

Note
Go do not use constructor and destructors, call
NewPtpEvent_v()
and
DeletePtpEvent_v()
explicitly.

◆ PtpEvent_v() [2/4]

PtpEvent_v::PtpEvent_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
NewPtpEvent_v(int64(size))
size_t size() const
and
DeletePtpEvent_v()
explicitly.

◆ PtpEvent_v() [3/4]

PtpEvent_v::PtpEvent_v ( size_t  size,
const PtpEvent_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.

◆ PtpEvent_v() [4/4]

PtpEvent_v::PtpEvent_v ( const PtpEvent_v container)

Copy constructor

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

Member Function Documentation

◆ back()

PtpEvent_t PtpEvent_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 PtpEvent_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 PtpEvent_v::clear ( )

Remove all elements from container

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

◆ empty()

bool PtpEvent_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()

PtpEvent_t PtpEvent_v::front ( )

Get first element from container

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

◆ get()

PtpEvent_t& PtpEvent_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 PtpEvent_v::max_size ( ) const

Get system limitation to container size

Note
This function available in Lua only.

◆ operator[]()

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

◆ pop()

PtpEvent_t PtpEvent_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<PtpEvent_t>::back() and std::vector<PtpEvent_t>::pop_back()
This function is not available in Lua and Go. Lua have the 'back()' and 'pop_back()' functions.

◆ pop_back()

void PtpEvent_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 PtpEvent_v::push ( const PtpEvent_t value)

Push a copy of element at the end of the container

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

◆ reserve()

void PtpEvent_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 PtpEvent_v::set ( size_t  position,
PtpEvent_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 PtpEvent_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: