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

#include <HandleManager.hpp>

Public Member Functions

 HandleManager ()=default
 
BasicHandleInfoaddHandle (GlobalFederateId fed_id, InterfaceType what, const std::string &key, const std::string &type, const std::string &units)
 
BasicHandleInfoaddHandle (GlobalFederateId fed_id, InterfaceHandle local_id, InterfaceType 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 (GlobalHandle handle)
 
BasicHandleInfogetHandleInfo (int32_t index)
 
const BasicHandleInfogetHandleInfo (int32_t index) const
 
BasicHandleInfogetHandleInfo (InterfaceHandle handle)
 
const BasicHandleInfogetHandleInfo (InterfaceHandle handle) const
 
BasicHandleInfofindHandle (GlobalHandle id)
 
const BasicHandleInfofindHandle (GlobalHandle id) const
 
void setHandleOption (InterfaceHandle handle, int32_t option, int32_t val)
 
int32_t getHandleOption (InterfaceHandle handle, int32_t option) const
 
BasicHandleInfogetEndpoint (std::string_view name)
 
const BasicHandleInfogetEndpoint (std::string_view name) const
 
BasicHandleInfogetEndpoint (InterfaceHandle handle)
 
const BasicHandleInfogetEndpoint (InterfaceHandle handle) const
 
const BasicHandleInfogetFilter (std::string_view name) const
 
BasicHandleInfogetFilter (std::string_view name)
 
BasicHandleInfogetFilter (InterfaceHandle handle)
 
BasicHandleInfogetPublication (std::string_view name)
 
const BasicHandleInfogetPublication (std::string_view name) const
 
BasicHandleInfogetPublication (InterfaceHandle handle)
 
BasicHandleInfogetInput (std::string_view name)
 
const BasicHandleInfogetInput (std::string_view name) const
 
LocalFederateId getLocalFedID (InterfaceHandle 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 ( GlobalFederateId  fed_id,
InterfaceHandle  local_id,
InterfaceType  what,
const std::string &  key,
const std::string &  type,
const std::string &  units 
)

add a handle to manage

◆ addHandle() [2/2]

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

add a handle to manage

References helics::InterfaceHandle::baseValue().

Referenced by addHandleAtIndex().

◆ 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 ( GlobalHandle  id)

find a handle from both the federate and local id

◆ findHandle() [2/2]

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

find a const handle from both the federate and local id

◆ getEndpoint() [1/4]

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

get an endpoint by index

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

References helics::InterfaceHandle::baseValue(), helics::ENDPOINT, and helics::isValidIndex().

◆ getEndpoint() [2/4]

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

get a const endpoint by index

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

References helics::InterfaceHandle::baseValue(), helics::ENDPOINT, and helics::isValidIndex().

◆ getEndpoint() [3/4]

BasicHandleInfo * helics::HandleManager::getEndpoint ( std::string_view  name)

◆ getEndpoint() [4/4]

const BasicHandleInfo * helics::HandleManager::getEndpoint ( std::string_view  name) const

get an endpoint from its name

◆ getFilter() [1/2]

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

get a filter by index

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

References helics::InterfaceHandle::baseValue(), helics::FILTER, and helics::isValidIndex().

◆ getFilter() [2/2]

const BasicHandleInfo * helics::HandleManager::getFilter ( std::string_view  name) const

get a const filter by name

◆ 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 ( InterfaceHandle  handle)

get a handle by index

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

◆ getHandleInfo() [4/4]

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

get a const handle by index

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

◆ getPublication()

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

get a publication by index

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

References helics::InterfaceHandle::baseValue(), helics::isValidIndex(), and helics::PUBLICATION.

◆ removeHandle()

void helics::HandleManager::removeHandle ( GlobalHandle  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: