Horizon
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
horizon::Pool Class Reference

Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool. More...

#include <pool.hpp>

Inheritance diagram for horizon::Pool:
horizon::IPool horizon::PoolUpdatePool horizon::ProjectPool horizon::PoolWithParametric

Classes

struct  ItemPoolInfo
 

Public Member Functions

 Pool (const std::string &base_path, bool read_only=true)
 Constructs a Pool.
 
std::shared_ptr< const class Unitget_unit (const UUID &uu, UUID *pool_uuid_out=nullptr) override
 
std::shared_ptr< const class Entityget_entity (const UUID &uu, UUID *pool_uuid_out=nullptr) override
 
std::shared_ptr< const class Symbolget_symbol (const UUID &uu, UUID *pool_uuid_out=nullptr) override
 
std::shared_ptr< const class Padstackget_padstack (const UUID &uu, UUID *pool_uuid_out=nullptr) override
 
std::shared_ptr< const class Padstackget_well_known_padstack (const std::string &name, UUID *pool_uuid_out=nullptr) override
 
std::shared_ptr< const class Packageget_package (const UUID &uu, UUID *pool_uuid_out=nullptr) override
 
std::shared_ptr< const class Partget_part (const UUID &uu, UUID *pool_uuid_out=nullptr) override
 
std::shared_ptr< const class Frameget_frame (const UUID &uu, UUID *pool_uuid_out=nullptr) override
 
std::shared_ptr< const class Decalget_decal (const UUID &uu, UUID *pool_uuid_out=nullptr) override
 
std::set< UUIDget_alternate_packages (const UUID &uu) override
 
std::string get_model_filename (const UUID &pkg_uuid, const UUID &model_uuid) override
 
virtual std::string get_filename (ObjectType type, const UUID &uu, UUID *pool_uuid_out=nullptr)
 
std::string get_rel_filename (ObjectType type, const UUID &uu)
 
const std::string & get_base_path () const override
 
bool check_filename (ObjectType type, const std::string &filename, std::string *error_msg=nullptr) const override
 
void check_filename_throw (ObjectType type, const std::string &filename) const override
 
SQLite::Databaseget_db () override
 
class PoolParametricget_parametric () override
 
const PoolInfoget_pool_info () const override
 
void clear () override
 Clears all lazy-loaded objects.
 
std::string get_tmp_filename (ObjectType type, const UUID &uu) const
 
std::map< std::string, UUIDget_actually_included_pools (bool include_self) override
 
UUID get_installation_uuid ()
 
ItemPoolInfo get_pool_uuids (ObjectType ty, const UUID &uu)
 

Static Public Member Functions

static int get_required_schema_version ()
 

Public Attributes

SQLite::Database db
 The database connection.
 

Static Public Attributes

static const UUID tmp_pool_uuid = "5e8d1bb6-7e61-4c59-9f01-1e1307069df0"
 
- Static Public Attributes inherited from horizon::IPool
static const std::map< ObjectType, std::string > type_names
 

Protected Member Functions

std::string get_flat_filename (ObjectType type, const UUID &uu) const
 
void get_pool_uuid (ObjectType type, const UUID &uu, UUID *pool_uuid_out)
 

Protected Attributes

const std::string base_path
 
const PoolInfo pool_info
 
std::map< UUID, std::shared_ptr< Unit > > units
 
std::map< UUID, std::shared_ptr< Entity > > entities
 
std::map< UUID, std::shared_ptr< Symbol > > symbols
 
std::map< UUID, std::shared_ptr< Padstack > > padstacks
 
std::map< UUID, std::shared_ptr< Package > > packages
 
std::map< UUID, std::shared_ptr< Part > > parts
 
std::map< UUID, std::shared_ptr< Frame > > frames
 
std::map< UUID, std::shared_ptr< Decal > > decals
 
std::map< std::pair< ObjectType, UUID >, UUIDpool_uuid_cache
 

Detailed Description

Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.

Objects are lazy-loaded when they're accessed for the first time.

Constructor & Destructor Documentation

◆ Pool()

horizon::Pool::Pool ( const std::string &  base_path,
bool  read_only = true 
)

Constructs a Pool.

Parameters
base_pathPath to the pool containing the pool.db

Member Function Documentation

◆ check_filename()

bool horizon::Pool::check_filename ( ObjectType  type,
const std::string &  filename,
std::string *  error_msg = nullptr 
) const
overridevirtual

Implements horizon::IPool.

◆ check_filename_throw()

void horizon::Pool::check_filename_throw ( ObjectType  type,
const std::string &  filename 
) const
overridevirtual

Implements horizon::IPool.

◆ clear()

void horizon::Pool::clear ( )
overridevirtual

Clears all lazy-loaded objects.

Doing so will invalidate all references pointers by get_entity and friends.

Implements horizon::IPool.

◆ get_actually_included_pools()

std::map< std::string, UUID > horizon::Pool::get_actually_included_pools ( bool  include_self)
overridevirtual

Implements horizon::IPool.

◆ get_alternate_packages()

std::set< UUID > horizon::Pool::get_alternate_packages ( const UUID uu)
overridevirtual

Implements horizon::IPool.

◆ get_base_path()

const std::string & horizon::Pool::get_base_path ( ) const
overridevirtual

Implements horizon::IPool.

◆ get_db()

SQLite::Database & horizon::Pool::get_db ( )
inlineoverridevirtual

Implements horizon::IPool.

◆ get_decal()

std::shared_ptr< const Decal > horizon::Pool::get_decal ( const UUID uu,
UUID pool_uuid_out = nullptr 
)
overridevirtual

Implements horizon::IPool.

◆ get_entity()

std::shared_ptr< const Entity > horizon::Pool::get_entity ( const UUID uu,
UUID pool_uuid_out = nullptr 
)
overridevirtual

Implements horizon::IPool.

◆ get_frame()

std::shared_ptr< const Frame > horizon::Pool::get_frame ( const UUID uu,
UUID pool_uuid_out = nullptr 
)
overridevirtual

Implements horizon::IPool.

◆ get_model_filename()

std::string horizon::Pool::get_model_filename ( const UUID pkg_uuid,
const UUID model_uuid 
)
overridevirtual

Implements horizon::IPool.

◆ get_package()

std::shared_ptr< const Package > horizon::Pool::get_package ( const UUID uu,
UUID pool_uuid_out = nullptr 
)
overridevirtual

Implements horizon::IPool.

◆ get_padstack()

std::shared_ptr< const Padstack > horizon::Pool::get_padstack ( const UUID uu,
UUID pool_uuid_out = nullptr 
)
overridevirtual

Implements horizon::IPool.

◆ get_parametric()

class PoolParametric * horizon::Pool::get_parametric ( )
inlineoverridevirtual

Implements horizon::IPool.

◆ get_part()

std::shared_ptr< const Part > horizon::Pool::get_part ( const UUID uu,
UUID pool_uuid_out = nullptr 
)
overridevirtual

Implements horizon::IPool.

◆ get_pool_info()

const PoolInfo & horizon::Pool::get_pool_info ( ) const
inlineoverridevirtual

Implements horizon::IPool.

◆ get_symbol()

std::shared_ptr< const Symbol > horizon::Pool::get_symbol ( const UUID uu,
UUID pool_uuid_out = nullptr 
)
overridevirtual

Implements horizon::IPool.

◆ get_unit()

std::shared_ptr< const Unit > horizon::Pool::get_unit ( const UUID uu,
UUID pool_uuid_out = nullptr 
)
overridevirtual

Implements horizon::IPool.

◆ get_well_known_padstack()

std::shared_ptr< const Padstack > horizon::Pool::get_well_known_padstack ( const std::string &  name,
UUID pool_uuid_out = nullptr 
)
overridevirtual

Implements horizon::IPool.

Member Data Documentation

◆ db

SQLite::Database horizon::Pool::db

The database connection.

You may use it to perform more advanced queries on the pool.


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