An identifier of a module's output. More...

#include <InputTag_fwd.h>

Detailed Description

An identifier of a module's output.

An InputTag embed two values:

  • The name of a module
  • The name of the output

Optionally, it can also embed an index if the output symbolized by the InputTag is a vector. The InputTag is then an indexed InputTag.

Definition at line 37 of file InputTag_fwd.h.

Public Member Functions

 InputTag (const std::string &module, const std::string &parameter)
 Construct a new InputTag. More...
 
 InputTag (const std::string &module, const std::string &parameter, size_t index)
 Construct a new indexed InputTag. More...
 
 InputTag ()=default
 Construct an empty InputTag.
 
bool operator== (const InputTag &rhs) const
 Test equality between two InputTags. More...
 
std::string toString () const
 Convert the InputTag in its string representation. More...
 
bool isIndexed () const
 
bool empty () const
 
void update ()
 Update the string representation of the InputTag.
 

Static Public Member Functions

static bool isInputTag (const std::string &tag)
 Check if a given string represent an InputTag. More...
 
static InputTag fromString (const std::string &tag)
 Create a input tag from its string representation. More...
 

Public Attributes

std::string module
 The module's name.
 
std::string parameter
 The module's output.
 
size_t index
 The index. Only meaningful if isIndexed() returns true.
 

Constructor & Destructor Documentation

◆ InputTag() [1/2]

InputTag::InputTag ( const std::string &  module,
const std::string &  parameter 
)

Construct a new InputTag.

Parameters
moduleThe name of the module
parameterThe name of the output

Definition at line 44 of file InputTag.cc.

◆ InputTag() [2/2]

InputTag::InputTag ( const std::string &  module,
const std::string &  parameter,
size_t  index 
)

Construct a new indexed InputTag.

Parameters
moduleThe name of the module
parameterThe name of the output
indexThe index inside the collection pointed by the InputTag

Definition at line 49 of file InputTag.cc.

Member Function Documentation

◆ empty()

bool InputTag::empty ( ) const
Returns
True if the InputTag is empty, false otherwise

Definition at line 97 of file InputTag.cc.

◆ fromString()

InputTag InputTag::fromString ( const std::string &  tag)
static

Create a input tag from its string representation.

Parameters
tagThe string representation of the InputTag
Warning
No check is performed to ensure that the string is an input tag. Use isInputTag() first.
Returns
A new InputTag, as described by tag.

Definition at line 75 of file InputTag.cc.

Referenced by lua::parameter(), and lua::to_any().

◆ isIndexed()

bool InputTag::isIndexed ( ) const
Returns
True if the InputTag is indexed, false otherwise

Definition at line 93 of file InputTag.cc.

◆ isInputTag()

bool InputTag::isInputTag ( const std::string &  tag)
static

Check if a given string represent an InputTag.

InputTag are represented as string in the following format:

Module::Parameter[/Index]

Delimiter is :: between the module's name and output, and / between the output and the index.

Warning
Index start at 1, and not at 0 like in C++. We follow here the Lua conventation for indexing.
Parameters
tagThe string to test
Returns
True if tag describes an InputTag, false otherwise

Definition at line 54 of file InputTag.cc.

Referenced by lua::parameter(), lua::to_any(), and lua::type().

◆ operator==()

bool InputTag::operator== ( const InputTag rhs) const

Test equality between two InputTags.

Two InputTags are equals if their module's name, output and index are the same

Returns
True if the two InputTag are equals, false otherwise

Definition at line 85 of file InputTag.cc.

◆ toString()

std::string InputTag::toString ( ) const

Convert the InputTag in its string representation.

Returns
A string representation of the InputTag

Definition at line 89 of file InputTag.cc.

Referenced by Pool::put().


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