RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
EndpointContainer类 参考

Container for endpoints, held by pointer. 更多...

#include <vrpn_EndpointContainer.h>

Public 类型

typedef vrpn_Endpoint_IP T
 
typedef Treference
 
typedef Tpointer
 
typedef vrpn_Endpointbase_pointer
 
typedef container_type::size_type size_type
 
typedef EndpointIterator iterator
 
typedef EndpointIterator const_iterator
 

Public 成员函数

 EndpointContainer ()
 Constructor of empty container.
 
 ~EndpointContainer ()
 Destructor - includes a call to clear()
 
void clear ()
 Tells each held endpoint in turn to drop the connection then deletes it
 
pointer front () const
 Shorthand for get_by_index(0)
 
template<typename T >
Tacquire (T *endpoint)
 Given the result of an endpoint allocator, if it's non-NULL, takes ownership of it.
 
void compact ()
 Goes through and gets rid of the NULL entries.
 
bool full () const
 Can we no longer accommodate a new endpoint?
 
bool is_valid (size_type i) const
 Checks to see if an index is both in-range and pointing to a still-extant object
 
bool destroy (base_pointer endpoint)
 Destroys the contained endpoint by address.
 
pointer get_by_index (size_type i) const
 
size_type get_full_container_size () const
 Get size of container including NULL elements that haven't been compacted yet.
 
iterator begin () const
 Get an iterator to the beginning that skips nulls. Invalidated by compacting.
 
iterator end () const
 Get an iterator suitable only for testing to see if we're "done"
 

详细描述

Container for endpoints, held by pointer.

To check if we have room, use this: if (d_endpoints.full()) {} instead of the old code looking like this: if (which_end >= vrpn_MAX_ENDPOINTS)

Usage example for iteration:

for (vrpn::EndpointIterator it = d_endpoints.begin(), e = d_endpoints.end();
it != e; ++it) {
it->pack_type_description(which)
}
An iterator that goes forward in an EndpointContainer skipping the NULLs, that also acts a bit like a...
定义 vrpn_EndpointContainer.h:164

构造及析构函数说明

◆ EndpointContainer()

Constructor of empty container.

◆ ~EndpointContainer()

Destructor - includes a call to clear()

成员函数说明

◆ acquire()

template<typename T >
T * acquire ( T * endpoint)
inline

Given the result of an endpoint allocator, if it's non-NULL, takes ownership of it.

返回
the input pointer

◆ begin()

EndpointIterator begin ( ) const
inline

Get an iterator to the beginning that skips nulls. Invalidated by compacting.

◆ clear()

void clear ( )

Tells each held endpoint in turn to drop the connection then deletes it

◆ compact()

void compact ( )
inline

Goes through and gets rid of the NULL entries.

◆ destroy()

bool destroy ( base_pointer endpoint)

Destroys the contained endpoint by address.

返回
true if there was something for us to delete

◆ end()

EndpointIterator end ( ) const
inline

Get an iterator suitable only for testing to see if we're "done"

◆ front()

pointer front ( ) const
inline

Shorthand for get_by_index(0)

◆ full()

bool full ( ) const

Can we no longer accommodate a new endpoint?

◆ get_full_container_size()

EndpointContainer::size_type get_full_container_size ( ) const
inline

Get size of container including NULL elements that haven't been compacted yet.

+ 这是这个函数的调用关系图:

◆ is_valid()

bool is_valid ( EndpointContainer::size_type i) const
inline

Checks to see if an index is both in-range and pointing to a still-extant object

+ 函数调用图:

该类的文档由以下文件生成: