summaryrefslogtreecommitdiff
path: root/src/expr/node_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/node_manager.cpp')
-rw-r--r--src/expr/node_manager.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp
index 5223fd02c..201e428de 100644
--- a/src/expr/node_manager.cpp
+++ b/src/expr/node_manager.cpp
@@ -24,6 +24,7 @@
#include "base/check.h"
#include "base/listener.h"
#include "expr/attribute.h"
+#include "expr/dtype.h"
#include "expr/node_manager_attributes.h"
#include "expr/node_manager_listeners.h"
#include "expr/type_checker.h"
@@ -186,6 +187,7 @@ NodeManager::~NodeManager() {
d_rt_cache.d_children.clear();
d_rt_cache.d_data = dummy;
+ // TODO: switch to DType
for (std::vector<Datatype*>::iterator
datatype_iter = d_ownedDatatypes.begin(),
datatype_end = d_ownedDatatypes.end();
@@ -253,10 +255,22 @@ unsigned NodeManager::registerDatatype(Datatype* dt) {
}
const Datatype & NodeManager::getDatatypeForIndex( unsigned index ) const{
+ // when the Node-level API is in place, this function will be deleted.
Assert(index < d_ownedDatatypes.size());
return *d_ownedDatatypes[index];
}
+const DType& NodeManager::getDTypeForIndex(unsigned index) const
+{
+ // when the Node-level API is in place, this function will be replaced by a
+ // direct lookup into a d_ownedDTypes vector, similar to d_ownedDatatypes
+ // above.
+ Unreachable() << "NodeManager::getDTypeForIndex: DType is not available in "
+ "the current implementation.";
+ const Datatype& d = getDatatypeForIndex(index);
+ return *d.d_internal;
+}
+
void NodeManager::reclaimZombies() {
// FIXME multithreading
Assert(!d_attrManager->inGarbageCollection());
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback