Apollo  6.0
Open source self driving car software
Public Member Functions | Protected Attributes | List of all members
apollo::localization::msf::BaseMapNodePool Class Referenceabstract

The memory pool for the data structure of BaseMapNode. More...

#include <base_map_pool.h>

Inheritance diagram for apollo::localization::msf::BaseMapNodePool:
Inheritance graph
Collaboration diagram for apollo::localization::msf::BaseMapNodePool:
Collaboration graph

Public Member Functions

 BaseMapNodePool (unsigned int pool_size, unsigned int thread_size)
 Constructor. More...
 
virtual ~BaseMapNodePool ()
 Destructor. More...
 
void Initial (const BaseMapConfig *map_config, bool is_fixed_size=true)
 Initialize the pool. More...
 
void Release ()
 Release the pool. More...
 
BaseMapNodeAllocMapNode ()
 Get a MapNode object from memory pool. More...
 
void FreeMapNode (BaseMapNode *map_node)
 Release MapNode object to memory pool. More...
 
unsigned int GetPoolSize ()
 Get the size of pool. More...
 

Protected Attributes

bool is_fixed_size_
 The flag of pool auto expand. More...
 
std::list< BaseMapNode * > free_list_
 The list for free node. More...
 
std::set< BaseMapNode * > busy_nodes_
 The set for used node. More...
 
unsigned int pool_size_
 The size of memory pool. More...
 
std::future< void > node_reset_workers_
 The thread pool for release node. More...
 
boost::mutex mutex_
 The mutex for release thread. More...
 
const BaseMapConfigmap_config_
 The mutex for release thread. More...
 

Detailed Description

The memory pool for the data structure of BaseMapNode.

Constructor & Destructor Documentation

◆ BaseMapNodePool()

apollo::localization::msf::BaseMapNodePool::BaseMapNodePool ( unsigned int  pool_size,
unsigned int  thread_size 
)

Constructor.

Parameters
<pool_size>The memory pool size.
<thread_size>The thread pool size.

◆ ~BaseMapNodePool()

virtual apollo::localization::msf::BaseMapNodePool::~BaseMapNodePool ( )
virtual

Destructor.

Member Function Documentation

◆ AllocMapNode()

BaseMapNode* apollo::localization::msf::BaseMapNodePool::AllocMapNode ( )

Get a MapNode object from memory pool.

Parameters
<return>The MapNode object.

◆ FreeMapNode()

void apollo::localization::msf::BaseMapNodePool::FreeMapNode ( BaseMapNode map_node)

Release MapNode object to memory pool.

Parameters
<map_node>The released MapNode object.

◆ GetPoolSize()

unsigned int apollo::localization::msf::BaseMapNodePool::GetPoolSize ( )
inline

Get the size of pool.

◆ Initial()

void apollo::localization::msf::BaseMapNodePool::Initial ( const BaseMapConfig map_config,
bool  is_fixed_size = true 
)

Initialize the pool.

Parameters
<map_config>The map option.
<is_fixed_size>The flag of pool auto expand.

◆ Release()

void apollo::localization::msf::BaseMapNodePool::Release ( )

Release the pool.

Member Data Documentation

◆ busy_nodes_

std::set<BaseMapNode*> apollo::localization::msf::BaseMapNodePool::busy_nodes_
protected

The set for used node.

◆ free_list_

std::list<BaseMapNode*> apollo::localization::msf::BaseMapNodePool::free_list_
protected

The list for free node.

◆ is_fixed_size_

bool apollo::localization::msf::BaseMapNodePool::is_fixed_size_
protected

The flag of pool auto expand.

◆ map_config_

const BaseMapConfig* apollo::localization::msf::BaseMapNodePool::map_config_
protected

The mutex for release thread.

◆ mutex_

boost::mutex apollo::localization::msf::BaseMapNodePool::mutex_
protected

The mutex for release thread.

◆ node_reset_workers_

std::future<void> apollo::localization::msf::BaseMapNodePool::node_reset_workers_
protected

The thread pool for release node.

◆ pool_size_

unsigned int apollo::localization::msf::BaseMapNodePool::pool_size_
protected

The size of memory pool.


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