3 #include <yuni/core/string.h> 5 #include "details/utils/stringrefs.h" 8 #include <unordered_map> 15 struct ClassdefTableView;
94 void bulkCreate(std::vector<CLID>& out, uint32_t atomid, uint32_t count);
99 void bulkAppend(uint32_t atomid, uint32_t offset, uint32_t count);
147 ClassdefTable&
operator = (
const ClassdefTable&) =
delete;
159 inline bool nameLookupForClassdef(
Classdef& classdef);
160 inline bool nameLookupForSelfInterface(
Classdef& classdef);
165 struct LayerItem final {
166 void swap(LayerItem& rhs);
169 uint32_t atomid = (uint32_t) - 1;
174 std::vector<bool> flags;
176 std::vector<Classdef> storage;
180 std::unordered_map<CLID, yuni::Ref<Classdef>> m_classdefs;
182 mutable LayerItem m_layer;
191 #include "classdef-table.hxx" Atom * findRawClassdefAtom(const Classdef &) const
Find the atom of a classdef, via its extends if necessary.
Definition: classdef-table.cpp:186
void bulkCreate(std::vector< CLID > &out, uint32_t atomid, uint32_t count)
Bulk create several class id.
Definition: classdef-table.cpp:146
const Classdef & rawclassdef(const CLID &) const
Retrieve a classdef from its ID without using the current layer.
Definition: classdef-table.cpp:69
Class definition.
Definition: classdef.h:24
Function definition.
Definition: funcdef.h:15
AtomMap atoms
Atom map.
Definition: classdef-table.h:155
StringRefs stringrefs
String dictionary.
Definition: classdef-table.h:153
Funcdef & addClassdefInterfaceSelf(const CLID &, const AnyString &name)
Get or create an interface from its name for a given CLID.
Definition: classdef-table.cpp:137
void bulkAppend(uint32_t atomid, uint32_t offset, uint32_t count)
Bulk append class id.
Definition: classdef-table.cpp:164
Definition: classdef-table.h:19
Atom * findClassdefAtom(const Classdef &) const
Find the atom of a classdef, via its extends if necessary.
Definition: classdef-table.cpp:204
ClassdefTable()
Default constructor.
Definition: classdef-table.cpp:13
void substituteResize(uint32_t count)
Resize the substitutes for the current layer.
Definition: classdef-table.cpp:233
ClassdefTable & operator=(const ClassdefTable &)=delete
No assignment operator.
void mergeSubstitutes()
Make substitutes permanent.
Definition: classdef-table.cpp:255
bool hasSubstitute(CLID) const
Get if the current layer has a substitute for a given CLID.
Definition: classdef-table.cpp:222
Atoms.
Definition: atom-map.h:17
bool hasClassdef(const CLID &) const
Get if a clid is available.
Definition: classdef-table.hxx:16
Definition of a single class or function.
Definition: atom.h:37
const Classdef & classdefFollowClassMember(const CLID &) const
Retrieve the real classdef from its ID (or from the current layer) even if a class member...
Definition: classdef-table.cpp:118
AnyString keyword(const Atom &) const
Get the keyword associated to an atom (class, func, var, cref, namespace...)
Definition: classdef-table.cpp:306
uint32_t substituteAtomID() const
Get the atom id of the current layer.
Definition: classdef-table.hxx:46
bool makeHardlink(const CLID &source, const CLID &target)
Make a target class ID share the same definition than a source class ID.
Definition: classdef-table.cpp:19
Funcdef & addClassdefInterface(const CLID &, const AnyString &name)
Get or create an interface from its name for a given CLID.
Definition: classdef-table.cpp:127
~ClassdefTable()=default
Destructor.
Classdef & substitute(uint32_t) const
Get the substiture for the current atomid in the current layer.
Definition: classdef-table.cpp:268
Definition: qualifiers.h:9
Classdef & addSubstitute(nytype_t kind, Atom *atom, const Qualifiers &) const
Append a new substitute.
Definition: classdef-table.cpp:285
void registerAtom(Atom &atom)
Register an Atom (created from blueprints)
Definition: classdef-table.cpp:177
Definition: classdef-table-view.h:9
Container for minimizing memory use of duplicate strings.
Definition: stringrefs.h:12
Classdef & classdef(const CLID &)
Retrieve or create a classdef from its ID.
Definition: classdef-table.cpp:45