5#ifndef IDDICT_IdDictGroup_H
6#define IDDICT_IdDictGroup_H
44 const std::string&
name()
const;
55 const std::vector<IdDictRegion*>&
regions();
67 const std::string& tag =
"");
87 std::vector<const IdDictFieldImplementation*>* impls =
nullptr)
const;
123 std::vector<std::unique_ptr<IdDictDictEntry> >
m_entries;
202 std::unique_ptr<std::vector<const IdDictFieldImplementation*> >
m_other_impls;
217 static constexpr unsigned END =
static_cast<unsigned> (-1);
const boost::regex re(r_e)
IdDictFieldImplementation is used to capture the specification of a single field of an Identifier.
const std::vector< IdDictRegion * > & regions()
Non-const access to regions.
bool m_generated_implementation
IdDictGroup(const IdDictGroup &)=delete
std::vector< IdDictRegionTreeNode > m_region_tree
The list of region nodes.
void add_dictentry(std::unique_ptr< IdDictDictEntry > entry)
std::vector< std::unique_ptr< IdDictDictEntry > > m_entries
void build_region_tree()
Take the list of regions and build a tree structure for fast unpacking.
int unpack(const Identifier &id, const ExpandedIdentifier &prefix, size_t index2, ExpandedIdentifier &unpackedId, std::vector< const IdDictFieldImplementation * > *impls=nullptr) const
Unpack the value_type id to an expanded Identifier, considering the provided prefix (result will incl...
void dump_tree() const
Dump the tree structure built from the regions for fast unpacking.
std::vector< IdDictRegion * > m_regions
void dump_regions() const
Dump the list of regions for this group.
void reset_implementation()
const IdDictRegion & region(size_t index) const
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="")
void add_tree_field(const IdDictRegion &re, unsigned ifield, unsigned inode)
Recursively add new nodes to the tree structure.
IdDictGroup & operator=(const IdDictGroup &)=delete
MultiRange build_multirange() const
Get MultiRange for this group.
const std::string & name() const
void dump() const
Dump regions and tree for this group.
void resolve_references(IdDictMgr &idd, IdDictDictionary &dictionary, size_t &index)
A MultiRange combines several Ranges.
std::pair< size_t, unsigned > ChildPair
References to child nodes.
const IdDictFieldImplementation & m_impl
Reference to the the implementation field.
std::variant< std::vector< unsigned >, ChildPair > m_children
std::unique_ptr< std::vector< const IdDictFieldImplementation * > > m_other_impls
Implementations for other field descriptions that this ored field of the identifier may contain.
void optimize()
Compress the vector of node indices, if they are all the same.
static constexpr unsigned END
Special value used to indicate that we've reached the end.
IdDictRegionTreeNode(const IdDictFieldImplementation &impl)
Constructor, taking a reference to the implementation.