Project
Loading...
Searching...
No Matches
o2::framework::DataSpecUtils Struct Reference

#include <DataSpecUtils.h>

Static Public Member Functions

static bool match (InputSpec const &spec, ConcreteDataMatcher const &target)
 
static bool match (InputSpec const &spec, ConcreteDataTypeMatcher const &target)
 
static bool match (OutputSpec const &left, OutputSpec const &right)
 
static bool match (OutputSpec const &spec, ConcreteDataMatcher const &target)
 
static bool match (InputSpec const &input, OutputSpec const &output)
 
static bool match (const InputSpec &spec, const o2::header::DataOrigin &origin, const o2::header::DataDescription &description, const o2::header::DataHeader::SubSpecificationType &subSpec)
 
static bool match (const OutputSpec &spec, const o2::header::DataOrigin &origin, const o2::header::DataDescription &description, const o2::header::DataHeader::SubSpecificationType &subSpec)
 
static bool match (const InputSpec &spec, o2::header::DataHeader const &dh)
 
static bool match (const OutputSpec &spec, o2::header::DataHeader const &dh)
 
template<typename ContainerT >
static std::optional< typename ContainerT::value_type > find (ContainerT const &container, const o2::header::DataOrigin &origin, const o2::header::DataDescription &description, const o2::header::DataHeader::SubSpecificationType &subSpec)
 
static bool partialMatch (InputSpec const &spec, o2::header::DataOrigin const &origin)
 
template<size_t N>
static bool partialMatch (InputSpec const &spec, std::array< header::DataOrigin, N > const &origins)
 
static bool partialMatch (OutputSpec const &spec, o2::header::DataOrigin const &origin)
 
template<size_t N>
static bool partialMatch (OutputSpec const &spec, std::array< header::DataOrigin, N > const &origins)
 
static bool partialMatch (InputSpec const &spec, o2::header::DataDescription const &description)
 
static bool partialMatch (OutputSpec const &spec, o2::header::DataDescription const &description)
 
template<typename T >
static bool match (const T &spec, const o2::header::DataHeader &header)
 
static std::string describe (InputSpec const &spec)
 
static std::string describe (OutputSpec const &spec)
 
static std::string label (InputSpec const &spec)
 
static std::string label (OutputSpec const &spec)
 
static std::string restEndpoint (InputSpec const &spec)
 
static void updateMatchingSubspec (InputSpec &in, header::DataHeader::SubSpecificationType subSpec)
 
static void updateMatchingSubspec (OutputSpec &in, header::DataHeader::SubSpecificationType subSpec)
 
static bool validate (InputSpec const &input)
 
static bool validate (OutputSpec const &output)
 
static void describe (char *buffer, size_t size, InputSpec const &spec)
 Same as the other describe, but uses a buffer to reduce memory churn.
 
static void describe (char *buffer, size_t size, OutputSpec const &spec)
 Same as the other describe, but uses a buffer to reduce memory churn.
 
static ConcreteDataMatcher asConcreteDataMatcher (InputSpec const &input)
 
static ConcreteDataMatcher asConcreteDataMatcher (OutputSpec const &spec)
 
static std::optional< ConcreteDataMatcherasOptionalConcreteDataMatcher (OutputSpec const &spec)
 
static ConcreteDataTypeMatcher asConcreteDataTypeMatcher (OutputSpec const &spec)
 
static ConcreteDataTypeMatcher asConcreteDataTypeMatcher (InputSpec const &spec)
 
static header::DataOrigin asConcreteOrigin (InputSpec const &spec)
 
static header::DataDescription asConcreteDataDescription (InputSpec const &spec)
 
static OutputSpec asOutputSpec (InputSpec const &spec)
 
static InputSpec matchingInput (OutputSpec const &spec)
 
static InputSpec fromMetadataString (std::string s)
 Create an InputSpec from metadata string.
 
static std::optional< header::DataOrigingetOptionalOrigin (InputSpec const &spec)
 Get the origin, if available.
 
static std::optional< header::DataDescriptiongetOptionalDescription (InputSpec const &spec)
 Get the description, if available.
 
static std::optional< header::DataHeader::SubSpecificationTypegetOptionalSubSpec (OutputSpec const &spec)
 Get the subspec, if available.
 
static std::optional< header::DataHeader::SubSpecificationTypegetOptionalSubSpec (InputSpec const &spec)
 Get the subspec, if available.
 
static data_matcher::DataDescriptorMatcher dataDescriptorMatcherFrom (ConcreteDataMatcher const &concrete)
 Build a DataDescriptMatcher which does not care about the subSpec.
 
static data_matcher::DataDescriptorMatcher dataDescriptorMatcherFrom (ConcreteDataTypeMatcher const &dataType)
 Build a DataDescriptMatcher which does not care about the subSpec.
 
static data_matcher::DataDescriptorMatcher dataDescriptorMatcherFrom (header::DataOrigin const &origin)
 Build a DataDescriptMatcher which does not care about the subSpec and description.
 
static data_matcher::DataDescriptorMatcher dataDescriptorMatcherFrom (header::DataDescription const &origin)
 Build a DataDescriptMatcher which does not care about the subSpec and origin.
 
static std::optional< framework::ConcreteDataMatcheroptionalConcreteDataMatcherFrom (data_matcher::DataDescriptorMatcher const &matcher)
 
static bool includes (const InputSpec &left, const InputSpec &right)
 Checks if left includes right (or is equal to)
 
static void updateInputList (std::vector< InputSpec > &list, InputSpec &&input)
 Updates list of InputSpecs by merging metadata.
 
static void updateOutputList (std::vector< OutputSpec > &list, OutputSpec &&input)
 Updates list of OutputSpecs by merging metadata (or adding output).
 

Detailed Description

Definition at line 26 of file DataSpecUtils.h.

Member Function Documentation

◆ asConcreteDataDescription()

header::DataDescription o2::framework::DataSpecUtils::asConcreteDataDescription ( InputSpec const &  spec)
static

If possible extract the DataDescription from an InputSpec. This will not always be possible, depending on how complex of a query the InputSpec does, however in most cases it should be ok and we can add corner cases as we go.

Definition at line 472 of file DataSpecUtils.cxx.

◆ asConcreteDataMatcher() [1/2]

ConcreteDataMatcher o2::framework::DataSpecUtils::asConcreteDataMatcher ( InputSpec const &  input)
static

If possible extract the ConcreteDataMatcher from an InputSpec. This can be done either if the InputSpec is defined in terms for a ConcreteDataMatcher or if the query can be uniquely assigned to a ConcreteDataMatcher.

Definition at line 397 of file DataSpecUtils.cxx.

◆ asConcreteDataMatcher() [2/2]

ConcreteDataMatcher o2::framework::DataSpecUtils::asConcreteDataMatcher ( OutputSpec const &  spec)
static

If possible extract the ConcreteDataMatcher from an OutputSpec. For the moment this is trivial as the OutputSpec does not allow for wildcards.

Exceptions
std::runtime_errorif the OutputSpec contains wildcards.

Definition at line 414 of file DataSpecUtils.cxx.

◆ asConcreteDataTypeMatcher() [1/2]

ConcreteDataTypeMatcher o2::framework::DataSpecUtils::asConcreteDataTypeMatcher ( InputSpec const &  spec)
static

If possible extract the ConcreteTypeDataMatcher from an InputSpec. This will not always be possible, depending on how complex of a query the InputSpec does, however in most cases it should be ok and we can add corner cases as we go.

Definition at line 440 of file DataSpecUtils.cxx.

◆ asConcreteDataTypeMatcher() [2/2]

ConcreteDataTypeMatcher o2::framework::DataSpecUtils::asConcreteDataTypeMatcher ( OutputSpec const &  spec)
static

If possible extract the ConcreteTypeDataMatcher from an OutputSpec. This will always be possible, but implementation will have to take into account the fact that the OutputSpec might have a wildcard on the subSpec.

Definition at line 432 of file DataSpecUtils.cxx.

◆ asConcreteOrigin()

header::DataOrigin o2::framework::DataSpecUtils::asConcreteOrigin ( InputSpec const &  spec)
static

If possible extract the DataOrigin from an InputSpec. This will not always be possible, depending on how complex of a query the InputSpec does, however in most cases it should be ok and we can add corner cases as we go.

Definition at line 456 of file DataSpecUtils.cxx.

◆ asOptionalConcreteDataMatcher()

std::optional< ConcreteDataMatcher > o2::framework::DataSpecUtils::asOptionalConcreteDataMatcher ( OutputSpec const &  spec)
static

As the other asConcreteDataMatcher, but returns a std::optional and does its best to handle the case where the OutputSpec contains a wildcard.

Definition at line 419 of file DataSpecUtils.cxx.

◆ asOutputSpec()

OutputSpec o2::framework::DataSpecUtils::asOutputSpec ( InputSpec const &  spec)
static

If possible extract either ConcreteTypeDataMatcher or ConcreteDataMatcher from an InputSpec and assign it to the matcher of the OutputSpec together with binding and lifetime If InputSpec holds a ConcreteDataMatcher, this will be used directly, if it is a DataDescriptorMatcher, depending on its complexity the ConcreteDataMatcher or ConcreteTypeDataMatcher will be created

Definition at line 488 of file DataSpecUtils.cxx.

◆ dataDescriptorMatcherFrom() [1/4]

DataDescriptorMatcher o2::framework::DataSpecUtils::dataDescriptorMatcherFrom ( ConcreteDataMatcher const &  concrete)
static

Build a DataDescriptMatcher which does not care about the subSpec.

Definition at line 507 of file DataSpecUtils.cxx.

◆ dataDescriptorMatcherFrom() [2/4]

DataDescriptorMatcher o2::framework::DataSpecUtils::dataDescriptorMatcherFrom ( ConcreteDataTypeMatcher const &  dataType)
static

Build a DataDescriptMatcher which does not care about the subSpec.

Definition at line 523 of file DataSpecUtils.cxx.

◆ dataDescriptorMatcherFrom() [3/4]

DataDescriptorMatcher o2::framework::DataSpecUtils::dataDescriptorMatcherFrom ( header::DataDescription const &  origin)
static

Build a DataDescriptMatcher which does not care about the subSpec and origin.

Definition at line 554 of file DataSpecUtils.cxx.

◆ dataDescriptorMatcherFrom() [4/4]

DataDescriptorMatcher o2::framework::DataSpecUtils::dataDescriptorMatcherFrom ( header::DataOrigin const &  origin)
static

Build a DataDescriptMatcher which does not care about the subSpec and description.

Definition at line 536 of file DataSpecUtils.cxx.

◆ describe() [1/4]

void o2::framework::DataSpecUtils::describe ( char buffer,
size_t  size,
InputSpec const &  spec 
)
static

Same as the other describe, but uses a buffer to reduce memory churn.

Definition at line 90 of file DataSpecUtils.cxx.

◆ describe() [2/4]

void o2::framework::DataSpecUtils::describe ( char buffer,
size_t  size,
OutputSpec const &  spec 
)
static

Same as the other describe, but uses a buffer to reduce memory churn.

Definition at line 108 of file DataSpecUtils.cxx.

◆ describe() [3/4]

std::string o2::framework::DataSpecUtils::describe ( InputSpec const &  spec)
static

Describes an InputSpec. Use this to get some human readable version of the contents of the InputSpec. Notice this is not part of the InputSpec API, because there is no unique way a description should be done, so we keep this outside.

Definition at line 70 of file DataSpecUtils.cxx.

◆ describe() [4/4]

std::string o2::framework::DataSpecUtils::describe ( OutputSpec const &  spec)
static

Describes an OutputSpec. Use this to get some human readable version of the contents of the OutputSpec.

Note
: Notice this is not part of the InputSpec API, because there is no unique way a description should be done, so we keep this outside.

Definition at line 82 of file DataSpecUtils.cxx.

◆ find()

template<typename ContainerT >
static std::optional< typename ContainerT::value_type > o2::framework::DataSpecUtils::find ( ContainerT const &  container,
const o2::header::DataOrigin origin,
const o2::header::DataDescription description,
const o2::header::DataHeader::SubSpecificationType subSpec 
)
inlinestatic

find a matching spec in the container

Returns
std::optional with found spec or std::nullopt

Definition at line 67 of file DataSpecUtils.h.

◆ fromMetadataString()

InputSpec o2::framework::DataSpecUtils::fromMetadataString ( std::string  s)
static

Create an InputSpec from metadata string.

Definition at line 668 of file DataSpecUtils.cxx.

◆ getOptionalDescription()

std::optional< header::DataDescription > o2::framework::DataSpecUtils::getOptionalDescription ( InputSpec const &  spec)
static

Get the description, if available.

Definition at line 706 of file DataSpecUtils.cxx.

◆ getOptionalOrigin()

std::optional< header::DataOrigin > o2::framework::DataSpecUtils::getOptionalOrigin ( InputSpec const &  spec)
static

Get the origin, if available.

Definition at line 687 of file DataSpecUtils.cxx.

◆ getOptionalSubSpec() [1/2]

std::optional< header::DataHeader::SubSpecificationType > o2::framework::DataSpecUtils::getOptionalSubSpec ( InputSpec const &  spec)
static

Get the subspec, if available.

Definition at line 737 of file DataSpecUtils.cxx.

◆ getOptionalSubSpec() [2/2]

std::optional< header::DataHeader::SubSpecificationType > o2::framework::DataSpecUtils::getOptionalSubSpec ( OutputSpec const &  spec)
static

Get the subspec, if available.

Definition at line 725 of file DataSpecUtils.cxx.

◆ includes()

bool o2::framework::DataSpecUtils::includes ( const InputSpec left,
const InputSpec right 
)
static

Checks if left includes right (or is equal to)

Definition at line 756 of file DataSpecUtils.cxx.

◆ label() [1/2]

std::string o2::framework::DataSpecUtils::label ( InputSpec const &  spec)
static

Provide a unique label for the input spec. Again this is outside because there is no standard way of doing it, so better not to pollute the API.

Definition at line 124 of file DataSpecUtils.cxx.

◆ label() [2/2]

std::string o2::framework::DataSpecUtils::label ( OutputSpec const &  spec)
static

Provide a unique label for the input spec. Again this is outside because there is no standard way of doing it, so better not to pollute the API.

Definition at line 140 of file DataSpecUtils.cxx.

◆ match() [1/10]

bool o2::framework::DataSpecUtils::match ( const InputSpec spec,
const o2::header::DataOrigin origin,
const o2::header::DataDescription description,
const o2::header::DataHeader::SubSpecificationType subSpec 
)
static

Definition at line 42 of file DataSpecUtils.cxx.

◆ match() [2/10]

static bool o2::framework::DataSpecUtils::match ( const InputSpec spec,
o2::header::DataHeader const &  dh 
)
inlinestatic

Definition at line 54 of file DataSpecUtils.h.

◆ match() [3/10]

bool o2::framework::DataSpecUtils::match ( const OutputSpec spec,
const o2::header::DataOrigin origin,
const o2::header::DataDescription description,
const o2::header::DataHeader::SubSpecificationType subSpec 
)
static

Definition at line 51 of file DataSpecUtils.cxx.

◆ match() [4/10]

static bool o2::framework::DataSpecUtils::match ( const OutputSpec spec,
o2::header::DataHeader const &  dh 
)
inlinestatic

Definition at line 59 of file DataSpecUtils.h.

◆ match() [5/10]

template<typename T >
static bool o2::framework::DataSpecUtils::match ( const T &  spec,
const o2::header::DataHeader header 
)
inlinestatic

Definition at line 108 of file DataSpecUtils.h.

◆ match() [6/10]

bool o2::framework::DataSpecUtils::match ( InputSpec const &  input,
OutputSpec const &  output 
)
static
Returns
true if a given InputSpec input matches the output outputspec

Definition at line 271 of file DataSpecUtils.cxx.

◆ match() [7/10]

bool o2::framework::DataSpecUtils::match ( InputSpec const &  spec,
ConcreteDataMatcher const &  target 
)
static
Returns
true if a given InputSpec spec matches with a target ConcreteDataMatcher

Definition at line 232 of file DataSpecUtils.cxx.

◆ match() [8/10]

bool o2::framework::DataSpecUtils::match ( InputSpec const &  spec,
ConcreteDataTypeMatcher const &  target 
)
static
Returns
true if a given InputSpec spec matches with a target ConcreteDataTypeMatcher

Definition at line 210 of file DataSpecUtils.cxx.

◆ match() [9/10]

bool o2::framework::DataSpecUtils::match ( OutputSpec const &  left,
OutputSpec const &  right 
)
static
Returns
true if matchers of the two specs match on all three levels if both matchers are of type ConcreteDataMatcher, on the level of origin and description otherwise

Definition at line 257 of file DataSpecUtils.cxx.

◆ match() [10/10]

bool o2::framework::DataSpecUtils::match ( OutputSpec const &  spec,
ConcreteDataMatcher const &  target 
)
static
Returns
true if a given OutputSpec spec matches with a target ConcreteDataMatcher

Definition at line 244 of file DataSpecUtils.cxx.

◆ matchingInput()

InputSpec o2::framework::DataSpecUtils::matchingInput ( OutputSpec const &  spec)
static

Create an InputSpec which is able to match all the outputs of the given OutputSpec

Definition at line 647 of file DataSpecUtils.cxx.

◆ optionalConcreteDataMatcherFrom()

std::optional< framework::ConcreteDataMatcher > o2::framework::DataSpecUtils::optionalConcreteDataMatcherFrom ( data_matcher::DataDescriptorMatcher const &  matcher)
static

return fully qualified ConcreteDataMatcher if DataMatcher is connecting unique properties via 'and' operation

Definition at line 572 of file DataSpecUtils.cxx.

◆ partialMatch() [1/6]

bool o2::framework::DataSpecUtils::partialMatch ( InputSpec const &  spec,
o2::header::DataDescription const &  description 
)
static
Returns
true if the OutputSpec will match at least the provided description.

Definition at line 290 of file DataSpecUtils.cxx.

◆ partialMatch() [2/6]

bool o2::framework::DataSpecUtils::partialMatch ( InputSpec const &  spec,
o2::header::DataOrigin const &  origin 
)
static
Returns
true if the InputSpec will match at least the provided origin.

Definition at line 285 of file DataSpecUtils.cxx.

◆ partialMatch() [3/6]

template<size_t N>
static bool o2::framework::DataSpecUtils::partialMatch ( InputSpec const &  spec,
std::array< header::DataOrigin, N > const &  origins 
)
inlinestatic
Returns
true if the InputSpec will match at least one of the provided origins

Definition at line 85 of file DataSpecUtils.h.

◆ partialMatch() [4/6]

bool o2::framework::DataSpecUtils::partialMatch ( OutputSpec const &  spec,
o2::header::DataDescription const &  description 
)
static
Returns
true if the OutputSpec will match at least the provided description.

Definition at line 299 of file DataSpecUtils.cxx.

◆ partialMatch() [5/6]

bool o2::framework::DataSpecUtils::partialMatch ( OutputSpec const &  spec,
o2::header::DataOrigin const &  origin 
)
static
Returns
true if the OutputSpec will match at least the provided origin.

Definition at line 279 of file DataSpecUtils.cxx.

◆ partialMatch() [6/6]

template<size_t N>
static bool o2::framework::DataSpecUtils::partialMatch ( OutputSpec const &  spec,
std::array< header::DataOrigin, N > const &  origins 
)
inlinestatic
Returns
true if the OutputSpec will match at least one of the provided origins

Definition at line 95 of file DataSpecUtils.h.

◆ restEndpoint()

std::string o2::framework::DataSpecUtils::restEndpoint ( InputSpec const &  spec)
static

Provides the to be used as suffix for any REST endpoint related to the spec.

Definition at line 149 of file DataSpecUtils.cxx.

◆ updateInputList()

void o2::framework::DataSpecUtils::updateInputList ( std::vector< InputSpec > &  list,
InputSpec &&  input 
)
static

Updates list of InputSpecs by merging metadata.

Definition at line 783 of file DataSpecUtils.cxx.

◆ updateMatchingSubspec() [1/2]

void o2::framework::DataSpecUtils::updateMatchingSubspec ( InputSpec in,
header::DataHeader::SubSpecificationType  subSpec 
)
static

Given an InputSpec, manipulate it so that it will match only the given subSpec.

Definition at line 158 of file DataSpecUtils.cxx.

◆ updateMatchingSubspec() [2/2]

void o2::framework::DataSpecUtils::updateMatchingSubspec ( OutputSpec in,
header::DataHeader::SubSpecificationType  subSpec 
)
static

Given an OutputSpec, manipulate it so that it will match only the given subSpec.

Definition at line 169 of file DataSpecUtils.cxx.

◆ updateOutputList()

void o2::framework::DataSpecUtils::updateOutputList ( std::vector< OutputSpec > &  list,
OutputSpec &&  input 
)
static

Updates list of OutputSpecs by merging metadata (or adding output).

Definition at line 799 of file DataSpecUtils.cxx.

◆ validate() [1/2]

bool o2::framework::DataSpecUtils::validate ( InputSpec const &  input)
static
Returns
true if the given InputSpec input is valid.

Definition at line 185 of file DataSpecUtils.cxx.

◆ validate() [2/2]

bool o2::framework::DataSpecUtils::validate ( OutputSpec const &  output)
static
Returns
true if the given OutputSpec out is valid.

Definition at line 200 of file DataSpecUtils.cxx.


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