Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::RepeatedGroup< Group, N > Class Template Reference

Defines a repeated group of a given type and a given number of repeats. More...

#include <ConfigRepresentation.hxx>

Inheritance diagram for openlcb::RepeatedGroup< Group, N >:
openlcb::ConfigEntryBase openlcb::ConfigReference

Public Types

using base_type = ConfigEntryBase
 

Public Member Functions

constexpr unsigned end_offset () const
 
template<int K>
constexpr Group entry () const
 
Group entry (unsigned k)
 
void handle_events (const EventOffsetCallback &fn)
 
- Public Member Functions inherited from openlcb::ConfigReference
constexpr ConfigReference (unsigned offset)
 Initializes the config reference from a configuration space offset.
 
constexpr ConfigReference (const ConfigReference &ref)
 Initializes the config reference from an existing config reference.
 
constexpr unsigned offset () const
 

Static Public Member Functions

static constexpr unsigned size ()
 
static constexpr unsigned num_repeats ()
 
static constexpr GroupConfigRenderer< Group > config_renderer ()
 
- Static Public Member Functions inherited from openlcb::ConfigEntryBase
template<typename... Args>
static constexpr GroupConfigOptions group_opts (Args... args)
 
static void handle_events (const EventOffsetCallback &fn)
 

Additional Inherited Members

- Protected Member Functions inherited from openlcb::ConfigEntryBase
template<class T >
raw_read (int fd) const
 Reads a given typed variable from the configuration file.
 
template<class T >
void raw_write (int fd, const T &value) const
 Writes a given typed variable to the configuration file.
 
void repeated_read (int fd, void *buf, size_t size) const
 Performs a reliable read from the given FD.
 
void repeated_write (int fd, const void *buf, size_t size) const
 Performs a reliable write to the given FD.
 
- Protected Attributes inherited from openlcb::ConfigReference
unsigned offset_
 zero-based offset from the beginning of the configuration file.
 

Detailed Description

template<class Group, unsigned N>
class openlcb::RepeatedGroup< Group, N >

Defines a repeated group of a given type and a given number of repeats.

Typical usage:

using AllConsumers = RepeatedGroup<ConsumerConfig, 3>;

then add AllConsumers as an entry to the enclosing group or segment.

Definition at line 333 of file ConfigRepresentation.hxx.

Member Typedef Documentation

◆ base_type

template<class Group , unsigned N>
using openlcb::RepeatedGroup< Group, N >::base_type = ConfigEntryBase

Definition at line 336 of file ConfigRepresentation.hxx.

Member Function Documentation

◆ config_renderer()

template<class Group , unsigned N>
static constexpr GroupConfigRenderer< Group > openlcb::RepeatedGroup< Group, N >::config_renderer ( )
inlinestaticconstexpr
Todo:
(balazs.racz) get rid of the instance of Group here.

Definition at line 363 of file ConfigRepresentation.hxx.

◆ end_offset()

template<class Group , unsigned N>
constexpr unsigned openlcb::RepeatedGroup< Group, N >::end_offset ( ) const
inlineconstexpr

Definition at line 342 of file ConfigRepresentation.hxx.

◆ entry() [1/2]

template<class Group , unsigned N>
template<int K>
constexpr Group openlcb::RepeatedGroup< Group, N >::entry ( ) const
inlineconstexpr

Definition at line 350 of file ConfigRepresentation.hxx.

◆ entry() [2/2]

template<class Group , unsigned N>
Group openlcb::RepeatedGroup< Group, N >::entry ( unsigned  k)
inline

Definition at line 357 of file ConfigRepresentation.hxx.

◆ handle_events()

template<class Group , unsigned N>
void openlcb::RepeatedGroup< Group, N >::handle_events ( const EventOffsetCallback fn)
inline

Definition at line 369 of file ConfigRepresentation.hxx.

◆ num_repeats()

template<class Group , unsigned N>
static constexpr unsigned openlcb::RepeatedGroup< Group, N >::num_repeats ( )
inlinestaticconstexpr

Definition at line 346 of file ConfigRepresentation.hxx.

◆ size()

template<class Group , unsigned N>
static constexpr unsigned openlcb::RepeatedGroup< Group, N >::size ( )
inlinestaticconstexpr

Definition at line 338 of file ConfigRepresentation.hxx.


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