ILLIXR: Illinois Extended Reality Testbed
Public Member Functions | List of all members
ILLIXR::switchboard::writer< specific_event > Class Template Reference

A handle which can publish events to a topic. More...

#include <switchboard.hpp>

Public Member Functions

 writer (topic &topic_)
 
template<class... Args>
ptr< specific_event > allocate (Args &&... args)
 Like new/malloc but more efficient for this specific case. More...
 
void put (ptr< specific_event > &&this_specific_event)
 Publish ev to this topic. More...
 

Detailed Description

template<typename specific_event>
class ILLIXR::switchboard::writer< specific_event >

A handle which can publish events to a topic.

Member Function Documentation

◆ allocate()

template<typename specific_event >
template<class... Args>
ptr<specific_event> ILLIXR::switchboard::writer< specific_event >::allocate ( Args &&...  args)
inline

Like new/malloc but more efficient for this specific case.

There is an optimization available which has not yet been implemented: switchboard can reuse memory from old events, like a slab allocator. Suppose module A publishes data for module B. B's deallocation through the destructor, and A's allocation through this method completes the cycle in a double-buffer (AKA swap-chain).

◆ put()

template<typename specific_event >
void ILLIXR::switchboard::writer< specific_event >::put ( ptr< specific_event > &&  this_specific_event)
inline

Publish ev to this topic.

TODO: Revisit for solution that guarantees uniqueness


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