|
WSF
|
#include <Message.hpp>


Public Member Functions | |
| Message (const std::string &aMTF, std::vector< std::unique_ptr< Set > > aSets) noexcept | |
| Message (const Message &)=delete | |
| Message & | operator= (const Message &)=delete |
| virtual | ~Message ()=default |
| const std::string & | GetType () const noexcept |
| Get the Type of the Message. | |
| const Set & | GetSet (Segment::SetPosition aSetIndex) const |
| Retrieve a Set at a given index. | |
| Segment::SetLocations | GetSets (const std::string &aSTF) const noexcept |
| Get all Sets that match the given set type. | |
| Segment::SetLocations | GetSets (const std::vector< std::string > &aSTF) const noexcept |
| Get all Sets that match any of the given set type. | |
| Segment | GetSegment (const Segment::SetPosition &startPosition, const Segment::SetPosition &stopPosition) const |
| Retrieve a grouping of sets by given start and end positions. | |
| std::vector< Segment > | GetSegments (const std::string &aSTF) const |
| size_t | GetNumberOfSets () const noexcept |
| Number of sets in the Message. | |
| bool | IsEmpty () const noexcept |
| Tells you if the Message doesn't contain Sets. | |
| Public Member Functions inherited from usmtf::Validatable | |
| bool | IsValid () const noexcept |
| Public Member Functions inherited from usmtf::ErrorManager | |
| virtual | ~ErrorManager ()=default |
| bool | HasErrors () const noexcept |
| void | LogErrors (std::ostream &aOut) const noexcept |
| const std::vector< ValidationError > & | GetErrors () const |
Protected Member Functions | |
| bool | IsSetPositionOutOfBounds (const Segment::SetPosition &aPos) const noexcept |
| Protected Member Functions inherited from usmtf::ErrorManager | |
| void | AddError (const ValidationError &aError) noexcept |
| void | AddError (const std::string &aFailureReason, const std::string &aValueValidatied, const std::string &aOptionalSuggestion="") noexcept |
| void | AddError (const std::string &aErrorMessage) noexcept |
| void | AddErrors (const std::vector< ValidationError > &aErrors) noexcept |
| void | ClearErrors () noexcept |
Protected Attributes | |
| const std::string | mMessageTextFormat |
| std::vector< std::unique_ptr< Set > > | mSets |
Message are the composition of predetermined sequence of sets. Its separated into three subdivisions:
Only the Main and closing text are governed by USMTF rules. 4.2.1.c (2), because of this, the parser advanced itself to the main text.
Messages contain sets, that when presented in a certain order outline logical ideas and transfer those ideas via the ordering and data in its enclosed Sets.
Messages have Sets which are sometimes grouped together or repeated to convey meaning. For us, this class can either subscribe to that meaning or ignore it. This is done through registering Sets we're interested in by providing the factory with a constructor for that set type, else the Set type is only parsed and put into mSets as a generic set that has no guarantees of correctness. After Sets are register a message may choose to extract segments its interested and turn those into other entities in the system.
Its set up this way to enable class authors to use what they need and ignore what they don't very easily. This might sounds complex, but its not after some examples, see the accompanying test suite for some inspiration. Or, if you fancy, a concrete use is found in aco.<c,h>pp
Messages are the file/document/white paper of the USMTF if you will.
|
noexcept |
References mMessageTextFormat, and mSets.
Referenced by usmtf::Aco::Aco(), usmtf::Ato::Ato(), Message(), and operator=().
|
delete |
References Message().
|
virtualdefault |
References GetNumberOfSets(), GetSegment(), GetSegments(), GetSet(), GetSets(), GetType(), IsEmpty(), and IsSetPositionOutOfBounds().
|
noexcept |
| Segment usmtf::Message::GetSegment | ( | const Segment::SetPosition & | startPosition, |
| const Segment::SetPosition & | stopPosition ) const |
Retrieve a grouping of sets by given start and end positions.
References GetSet(), and IsSetPositionOutOfBounds().
Referenced by GetSegments(), and ~Message().
| std::vector< Segment > usmtf::Message::GetSegments | ( | const std::string & | aSTF | ) | const |
Returns vector of segments that start with set type and go until next position is found. If set type is not found at all, no segments are returned. If Set Type is found only once, Vector will contain a single segment of that set until the end of the message.
References GetNumberOfSets(), GetSegment(), and GetSets().
Referenced by ~Message().
| const Set & usmtf::Message::GetSet | ( | Segment::SetPosition | aSetIndex | ) | const |
|
noexcept |
Get all Sets that match the given set type.
References mSets.
Referenced by GetSegments(), and ~Message().
|
noexcept |
Get all Sets that match any of the given set type.
References usmtf::FFIRN_Validator::IsInSelection(), and mSets.
|
noexcept |
|
noexcept |
|
protectednoexcept |
References mSets.
Referenced by GetSegment(), and ~Message().
|
protected |
|
protected |
Referenced by GetNumberOfSets(), GetSet(), GetSets(), GetSets(), IsEmpty(), IsSetPositionOutOfBounds(), and Message().