Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::GroupConfigOptions Class Reference

Implementation class for the condifuration options of a CDI group element. More...

#include <ConfigRenderer.hxx>

Inheritance diagram for openlcb::GroupConfigOptions:
OptionalArg< Decl, Args >

Public Member Functions

 INHERIT_CONSTEXPR_CONSTRUCTOR (GroupConfigOptions, GroupConfigDefs::Base)
 
 DEFINE_OPTIONALARG (Name, name, const char *)
 
 DEFINE_OPTIONALARG (Description, description, const char *)
 Represent the value enclosed in the tag of the data element.
 
 DEFINE_OPTIONALARG (Offset, offset, int)
 Represents the 'offset' attribute for groups and the 'origin' attribute for segments.
 
 DEFINE_OPTIONALARG (Segment, segment, int)
 Declares that the group is a segment (and thus may be used in the toplevel CDI.
 
 DEFINE_OPTIONALARG (RepName, repname, const char *)
 Specifies for the UI what the repetitions of this group should be called.
 
 DEFINE_OPTIONALARG (FixedSize, fixed_size, int)
 Specifies that the size of this group should be fixed to this many bytes, even if the contents are smaller.
 
 DEFINE_OPTIONALARG (Hidden, hidden, int)
 If non-zero, the group contents will not be rendered in the CDI, effectively hiding hte settings from the user.
 
 DEFINE_OPTIONALARG (Hints, hints, const char *)
 Represent the value enclosed in the <hints> tag of the data element.
 
 DEFINE_OPTIONALARG (LinkRef, linkref, const char *)
 Represent the <link ref=..>> value.
 
 DEFINE_OPTIONALARG (LinkText, linktext, const char *)
 Represent the value enclosed in the <link> tag of the data element.
 
constexpr int skip_init () const
 Declares that this group is a toplevel CDI.
 
constexpr bool is_cdi () const
 
constexpr bool is_segment () const
 
constexpr unsigned get_segment_offset () const
 
void render_cdi (std::string *r) const
 

Detailed Description

Implementation class for the condifuration options of a CDI group element.

Definition at line 288 of file ConfigRenderer.hxx.

Member Function Documentation

◆ DEFINE_OPTIONALARG() [1/2]

openlcb::GroupConfigOptions::DEFINE_OPTIONALARG ( FixedSize  ,
fixed_size  ,
int   
)

Specifies that the size of this group should be fixed to this many bytes, even if the contents are smaller.

Creates a compile error if the size is bigger.

◆ DEFINE_OPTIONALARG() [2/2]

openlcb::GroupConfigOptions::DEFINE_OPTIONALARG ( Hidden  ,
hidden  ,
int   
)

If non-zero, the group contents will not be rendered in the CDI, effectively hiding hte settings from the user.

The space will still be reserved and skipped.

◆ get_segment_offset()

constexpr unsigned openlcb::GroupConfigOptions::get_segment_offset ( ) const
inlineconstexpr
Returns
the origin of the current segment or zero (default) if not specified.

Definition at line 367 of file ConfigRenderer.hxx.

◆ is_cdi()

constexpr bool openlcb::GroupConfigOptions::is_cdi ( ) const
inlineconstexpr
Returns
true if this group is a toplevel CDI definition and shall only allow segments and other toplevel-compatible entries (but no data elements).

Definition at line 350 of file ConfigRenderer.hxx.

◆ is_segment()

constexpr bool openlcb::GroupConfigOptions::is_segment ( ) const
inlineconstexpr
Returns
true if this group is a segment definition.

Definition at line 358 of file ConfigRenderer.hxx.

◆ render_cdi()

void openlcb::GroupConfigOptions::render_cdi ( std::string *  r) const
inline

Definition at line 372 of file ConfigRenderer.hxx.

◆ skip_init()

constexpr int openlcb::GroupConfigOptions::skip_init ( ) const
inlineconstexpr

Declares that this group is a toplevel CDI.

Causes the group to render the xml header. static constexpr Segment MainCdi() { return Segment(-2); }

Definition at line 340 of file ConfigRenderer.hxx.


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