helics  2.8.1
Public Member Functions | List of all members
helics::HandleManager Class Reference

#include <HandleManager.hpp>

Public Member Functions

 HandleManager ()=default
 
BasicHandleInfoaddHandle (global_federate_id fed_id, handle_type what, const std::string &key, const std::string &type, const std::string &units)
 
BasicHandleInfoaddHandle (global_federate_id fed_id, interface_handle local_id, handle_type what, const std::string &key, const std::string &type, const std::string &units)
 
void addHandle (const BasicHandleInfo &otherHandle)
 
void addHandleAtIndex (const BasicHandleInfo &otherHandle, int32_t index)
 
void removeHandle (global_handle handle)
 
BasicHandleInfogetHandleInfo (int32_t index)
 
const BasicHandleInfogetHandleInfo (int32_t index) const
 
BasicHandleInfogetHandleInfo (interface_handle handle)
 
const BasicHandleInfogetHandleInfo (interface_handle handle) const
 
BasicHandleInfofindHandle (global_handle id)
 
const BasicHandleInfofindHandle (global_handle id) const
 
void setHandleOption (interface_handle handle, int32_t option, int32_t val)
 
int32_t getHandleOption (interface_handle handle, int32_t option) const
 
BasicHandleInfogetEndpoint (const std::string &name)
 
const BasicHandleInfogetEndpoint (const std::string &name) const
 
BasicHandleInfogetEndpoint (interface_handle handle)
 
const BasicHandleInfogetEndpoint (interface_handle handle) const
 
const BasicHandleInfogetFilter (const std::string &name) const
 
BasicHandleInfogetFilter (const std::string &name)
 
BasicHandleInfogetFilter (interface_handle handle)
 
BasicHandleInfogetPublication (const std::string &name)
 
const BasicHandleInfogetPublication (const std::string &name) const
 
BasicHandleInfogetPublication (interface_handle handle)
 
BasicHandleInfogetInput (const std::string &name)
 
const BasicHandleInfogetInput (const std::string &name) const
 
local_federate_id getLocalFedID (interface_handle handle) const
 
BasicHandleInfooperator[] (size_t index)
 
const BasicHandleInfooperator[] (size_t index) const
 
auto begin ()
 
auto end ()
 
auto begin () const
 
auto end () const
 
auto size () const
 

Detailed Description

class for managing a coordinating the different types of handles used in helics

this class is not designed to be thread safe that would require a wrapper around it

Constructor & Destructor Documentation

◆ HandleManager()

helics::HandleManager::HandleManager ( )
default

default constructor

Member Function Documentation

◆ addHandle() [1/2]

BasicHandleInfo & helics::HandleManager::addHandle ( global_federate_id  fed_id,
handle_type  what,
const std::string &  key,
const std::string &  type,
const std::string &  units 
)

add a handle to manage

References helics::interface_handle::baseValue().

Referenced by addHandleAtIndex().

◆ addHandle() [2/2]

BasicHandleInfo & helics::HandleManager::addHandle ( global_federate_id  fed_id,
interface_handle  local_id,
handle_type  what,
const std::string &  key,
const std::string &  type,
const std::string &  units 
)

add a handle to manage

◆ addHandleAtIndex()

void helics::HandleManager::addHandleAtIndex ( const BasicHandleInfo otherHandle,
int32_t  index 
)

add a handle at the specified index

References addHandle(), and helics::isValidIndex().

◆ findHandle() [1/2]

BasicHandleInfo * helics::HandleManager::findHandle ( global_handle  id)

find a handle from both the federate and local id

◆ findHandle() [2/2]

const BasicHandleInfo * helics::HandleManager::findHandle ( global_handle  id) const

find a const handle from both the federate and local id

◆ getEndpoint() [1/4]

BasicHandleInfo * helics::HandleManager::getEndpoint ( const std::string &  name)

◆ getEndpoint() [2/4]

const BasicHandleInfo * helics::HandleManager::getEndpoint ( const std::string &  name) const

get an endpoint from its name

◆ getEndpoint() [3/4]

BasicHandleInfo * helics::HandleManager::getEndpoint ( interface_handle  handle)

get an endpoint by index

Returns
nullptr if the index doesn't point to a valid endpoint

References helics::interface_handle::baseValue(), helics::endpoint, and helics::isValidIndex().

◆ getEndpoint() [4/4]

const BasicHandleInfo * helics::HandleManager::getEndpoint ( interface_handle  handle) const

get a const endpoint by index

Returns
nullptr if the index doesn't point to a valid endpoint

References helics::interface_handle::baseValue(), helics::endpoint, and helics::isValidIndex().

◆ getFilter() [1/2]

const BasicHandleInfo * helics::HandleManager::getFilter ( const std::string &  name) const

get a const filter by name

◆ getFilter() [2/2]

BasicHandleInfo * helics::HandleManager::getFilter ( interface_handle  handle)

get a filter by index

Returns
nullptr if the index doesn't point to a valid filter

References helics::interface_handle::baseValue(), helics::filter, and helics::isValidIndex().

◆ getHandleInfo() [1/4]

BasicHandleInfo * helics::HandleManager::getHandleInfo ( int32_t  index)

get a handle by index

References helics::isValidIndex().

◆ getHandleInfo() [2/4]

const BasicHandleInfo * helics::HandleManager::getHandleInfo ( int32_t  index) const

get a const handle by index

References helics::isValidIndex().

◆ getHandleInfo() [3/4]

BasicHandleInfo * helics::HandleManager::getHandleInfo ( interface_handle  handle)

get a handle by index

References helics::interface_handle::baseValue(), and helics::isValidIndex().

◆ getHandleInfo() [4/4]

const BasicHandleInfo * helics::HandleManager::getHandleInfo ( interface_handle  handle) const

get a const handle by index

References helics::interface_handle::baseValue(), and helics::isValidIndex().

◆ getPublication()

BasicHandleInfo * helics::HandleManager::getPublication ( interface_handle  handle)

get a publication by index

Returns
nullptr if the index doesn't point to a valid publication

References helics::interface_handle::baseValue(), helics::isValidIndex(), and helics::publication.

◆ removeHandle()

void helics::HandleManager::removeHandle ( global_handle  handle)

remove the information at the specified handle

References helics::endpoint, helics::filter, helics::input, and helics::publication.


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