20 #include "SheafSystem/dof_map_factory.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/poset_dof_map.h" 46 prototypes_map_type::iterator itr = _prototypes_map.begin();
47 while(itr != _prototypes_map.end())
52 _prototypes_map.clear();
59 ensure(unexecutable(
"All prototypes have been deleted."));
75 require(contains_prototype(xclient_class_name) ||
76 contains_prototype(xsheaf_base_class_id));
80 if(!xclient_class_name.empty())
84 prototypes_map_type::iterator itr = _prototypes_map.find(xclient_class_name);
85 if( itr != _prototypes_map.end())
89 result = itr->second->
clone();
95 result = _sheaf_prototypes_map[xsheaf_base_class_id]->
clone();
102 result = _sheaf_prototypes_map[xsheaf_base_class_id]->
clone();
122 require(xprototype != 0);
132 string lclass_name = xprototype->
class_name();
134 #ifdef DIAGNOSTIC_OUTPUT 136 cout <<
"in dof_map_factory::insert_prototype lclass_name = " 141 prototypes_map_type::value_type lval(lclass_name, const_cast<poset_dof_map*>(xprototype));
142 _prototypes_map.insert(lval);
146 ensure(contains_prototype(xprototype->
class_name()));
160 require(xprototype != 0);
165 _sheaf_prototypes_map[xtype_id] =
const_cast<poset_dof_map*
>(xprototype);
169 ensure(contains_prototype(xtype_id));
185 if(!xclass_name.empty())
187 prototypes_map_type::iterator itr = _prototypes_map.find(xclass_name);
188 if(itr != _prototypes_map.end())
191 _prototypes_map.erase(itr);
201 ensure(!contains_prototype(xclass_name));
220 !xclass_name.empty() &&
221 (_prototypes_map.find(xclass_name) != _prototypes_map.end());
243 result = (_sheaf_prototypes_map[xtype_id] != 0);
259 sheaf::dof_map_factory::
270 _sheaf_prototypes_map.reserve(NOT_A_DOF_TUPLE_TYPE);
271 _sheaf_prototypes_map.set_ct(NOT_A_DOF_TUPLE_TYPE);
272 _sheaf_prototypes_map.assign(0);
bool contains_prototype(const std::string &xclass_name) const
True if the set of prototypes contains a prototype for handles of type xclass_name.
bool is_initialized() const
True if this has been initialized, that is, if the schema has been set and the dof map storage alloca...
The general, abstract map from dof ids to dof values.
virtual ~dof_map_factory()
Destructor.
poset_dof_map * new_dof_map(const std::string &xclient_class_name, dof_tuple_type xsheaf_base_class_id)
Creates an uninitialized dof map of type xclient_class_name or type xsheaf_base_class_id if no protot...
dof_tuple_type
Identifiers for dof tuple types.
void delete_prototype(const std::string &xclass_name)
Removes the prototype for handles of type xclass_name.
void insert_prototype(const poset_dof_map *xprototype)
Sets xprototype as the prototype for its client class.
virtual const std::string & class_name() const
The name of the actual (possibly derived) class of this instance.
virtual poset_dof_map * clone() const =0
Virtual default constructor.