39 return std::string(
"cannot find superclass \'") + name +
"\' of class \'" + c.get_name() +
'\'';
46 s <<
"failed to convert \'" << a.get_name() <<
"\" value of object " << o <<
" because:\n" + reason;
53 return std::string(
"cannot register class \'") + c.get_name() +
"\' " + what +
"because:\n" + reason;
59 return std::string(
"cannot destroy class \'") + c.get_name() +
"\' because:\n" + reason;
65 return std::string(
"cannot ") + op +
" object \'" + oid +
"\' in class \'" + c.get_name() +
"\' because:\n" + reason;
71 return std::string(
"method \'") + op +
"()\' failed because:\n" + reason;
83 p_to_be_deleted (false),
84 p_all_super_classes (0),
85 p_all_sub_classes (0),
87 p_all_relationships (0),
89 p_inheritance_hierarchy (0),
117 p_to_be_deleted (false),
118 p_all_super_classes (0),
119 p_all_sub_classes (0),
120 p_all_attributes (0),
121 p_all_relationships (0),
123 p_inheritance_hierarchy (0),
144 p_description (description),
149 p_abstract (is_abstract),
151 p_to_be_deleted (false),
152 p_all_super_classes (0),
153 p_all_sub_classes (0),
154 p_all_attributes (0),
155 p_all_relationships (0),
157 p_inheritance_hierarchy (0),
158 p_file (kernel->p_active_schema),
175 if(!c->p_transient && c->p_kernel) {
176 std::unique_lock lock(c->p_kernel->p_kernel_mutex);
180 c->p_file->set_updated();
202 for (
const auto &x : *list)
215 for (
const auto &x : *map)
245 c->create_sub_classes();
263 std::cerr <<
"internal OKS error: registrate_class_change() failed during \'" <<
get_name() <<
"\' class destruction\ncaused by: " << ex.
what() << std::endl;
310 if(
this == &c)
return true;
313 (p_name != c.p_name) ||
314 (p_description != c.p_description) ||
315 (p_abstract != c.p_abstract)
319 int l1 = (p_attributes == 0) ? 0 : p_attributes->size();
320 int l2 = (c.p_attributes == 0) ? 0 : c.p_attributes->size();
322 if(l1 != l2)
return false;
325 std::list<OksAttribute *>::const_iterator i1 = p_attributes->begin();
326 std::list<OksAttribute *>::const_iterator i2 = c.p_attributes->begin();
328 for(;i1 != p_attributes->end();++i1, ++i2)
329 if( !(*(*i1) == *(*i2)) )
return false;
332 l1 = (p_relationships == 0) ? 0 : p_relationships->size();
333 l2 = (c.p_relationships == 0) ? 0 : c.p_relationships->size();
335 if(l1 != l2)
return false;
338 std::list<OksRelationship *>::const_iterator i1 = p_relationships->begin();
339 std::list<OksRelationship *>::const_iterator i2 = c.p_relationships->begin();
341 for(;i1 != p_relationships->end();++i1, ++i2)
342 if( !(*(*i1) == *(*i2)) )
return false;
345 l1 = (p_super_classes == 0) ? 0 : p_super_classes->size();
346 l2 = (c.p_super_classes == 0) ? 0 : c.p_super_classes->size();
348 if(l1 != l2)
return false;
351 std::list<std::string *>::const_iterator i1 = p_super_classes->begin();
352 std::list<std::string *>::const_iterator i2 = c.p_super_classes->begin();
354 for(;i1 != p_super_classes->end();++i1, ++i2)
355 if( !(*(*i1) == *(*i2)) )
return false;
364 if(
this == &c)
return false;
369 int l2 = (c.p_methods == 0) ? 0 : c.p_methods->size();
371 if(l1 != l2)
return true;
374 std::list<OksMethod *>::const_iterator i1 =
p_methods->begin();
375 std::list<OksMethod *>::const_iterator i2 = c.p_methods->begin();
378 if( !(*(*i1) == *(*i2)) )
return true;
390 s <<
"Class name: \"" << c.p_name <<
"\"\n"
391 " has description: \"" << c.p_description <<
"\"\n"
392 << (c.p_abstract ==
true ?
" is abstract\n" :
" is not abstract\n");
394 if(c.p_super_classes) {
395 s <<
"The class has superclasses:\n";
396 for(std::list<std::string *>::const_iterator i = c.p_super_classes->begin(); i != c.p_super_classes->end(); ++i) {
397 s <<
" - " << *(*i) << std::endl;
401 s <<
"The class has no superclasses\n";
405 s <<
"The attributes are:\n";
406 for(std::list<OksAttribute *>::const_iterator i = c.p_attributes->begin(); i != c.p_attributes->end(); ++i) {
411 s <<
"There are no attributes\n";
414 if(c.p_relationships) {
415 s <<
"The relationships are:\n";
416 for(std::list<OksRelationship *>::const_iterator i = c.p_relationships->begin(); i != c.p_relationships->end(); ++i) {
421 s <<
"There are no relationships\n";
425 s <<
"The methods are:\n";
426 for(std::list<OksMethod *>::const_iterator i = c.p_methods->begin(); i != c.p_methods->end(); ++i) {
431 s <<
"There are no methods\n";
437 s <<
"The objects are:\n";
439 for(OksObject::Map::iterator i = c.p_objects->begin(); i != c.p_objects->end(); ++i) {
440 sorted[i->first] = i->second;
443 for(OksObject::SMap::iterator i = sorted.begin(); i != sorted.end(); ++i) {
448 s <<
"There are no objects\n";
451 s <<
"End of Class \"" << c.p_name <<
"\"\n";
506 catch (std::exception & e) {
520 p_to_be_deleted (false),
521 p_all_super_classes (0),
522 p_all_sub_classes (0),
523 p_all_attributes (0),
524 p_all_relationships (0),
526 p_inheritance_hierarchy (0),
538 const char * tag_start = s.get_tag_start();
541 if(!strcmp(tag_start,
"/oks-schema")) {
550 catch (std::exception & e) {
571 s.throw_unexpected_tag(attr.
name(),
"oks-class\' attribute");
578 catch (std::exception & e) {
586 catch(std::exception& ex) {
597 const char * tag_start = s.get_tag_start();
607 unsigned long scl_pos = s.get_line_no();
612 std::string * scl =
new std::string(attr.
value(), attr.
value_len());
615 std::ostringstream text;
616 text <<
"second inclusion of super-class \"" + *scl +
"\" at line " << scl_pos;
618 throw std::runtime_error(text.str().c_str());
627 catch (std::exception & e) {
636 unsigned long attr_pos = s.get_line_no();
642 std::ostringstream text;
643 text <<
"redefinition of attribute with name \"" + a->
get_name() +
"\" at line " << attr_pos;
645 throw std::runtime_error(text.str().c_str());
652 catch (std::exception & e) {
661 unsigned long rel_pos = s.get_line_no();
667 std::ostringstream text;
668 text <<
"redefinition of relationship with name \"" + r->get_name() +
"\" at line " << rel_pos;
670 throw std::runtime_error(text.str().c_str());
677 catch (std::exception & e) {
686 unsigned long method_pos = s.get_line_no();
692 std::ostringstream text;
693 text <<
"redefinition of method with name \"" + m->get_name() +
"\" at line " << method_pos;
695 throw std::runtime_error(text.str().c_str());
702 catch (std::exception & e) {
712 s.throw_unexpected_tag(tag_start);
722 catch (std::exception & e) {
744 if(p_all_super_classes && !p_all_super_classes->empty()) {
745 for(FList::const_iterator i = p_all_super_classes->begin(); i != p_all_super_classes->end(); ++i) {
746 if((*i)->get_name() == nm)
return *i;
756 if(p_super_classes) {
757 for(std::list<std::string *>::const_iterator i = p_super_classes->begin(); i != p_super_classes->end(); ++i)
758 if(nm == *(*i))
return true;
834 const std::string& item1_name,
const std::string& item2_name,
835 const std::string& class_name,
bool b1,
bool b2)
839 const std::string * name;
845 for(
int i = 0; i < 2; ++i) {
847 std::string text(
"cannot find direct ");
850 text += *info[i].name;
851 text +=
"\" in class \"";
862 return (std::string(
"cannot add superclass \"") + c1 +
"\" to class \"" + c2 +
'\"');
886 text +=
" because class \"" +
p_name +
"\" already has such superclass.";
893 text +=
" because names of classes are the same.";
902 text +=
" because class \"" + nm +
"\" is already direct superclass of \"" +
p_name +
"\".";
907 text +=
" because class \"" + nm +
"\" is already non-direct superclass of \"" +
p_name +
"\".";
923 return (std::string(
"cannot remove superclass \"") + c1 +
"\" from class \"" + c2 +
'\"');
931 text +=
" because class \"" +
p_name +
"\" has no superclasses at all.";
937 std::string * si(*i);
939 lock_file(
"OksClass::remove_super_class");
956 text +=
" because class \"" +
p_name +
"\" has no superclass with this name.";
964 const char * fname =
"OksClass::swap_super_classes()";
983 if(*(*i) == c1) i1 = i;
984 else if(*(*i) == c2) i2 = i;
990 "OksClass::swap_super_classes",
"superclass", c1, c2,
p_name,
997 lock_file(
"OksClass::swap_super_classes");
999 std::string * s1 = *i1;
1000 std::string * s2 = *i2;
1017 for(std::list<OksAttribute *>::const_iterator i = p_attributes->begin(); i != p_attributes->end(); ++i)
1018 if(_name == (*i)->get_name())
return *i;
1028 if(p_all_attributes) {
1029 for(std::list<OksAttribute *>::const_iterator i = p_all_attributes->begin(); i != p_all_attributes->end(); ++i)
1030 if(_name == (*i)->get_name())
return *i;
1035 return find_direct_attribute(_name);
1047 attribute->p_class =
this;
1054 const char * fname =
"OksClass::add(OksAttribute *)";
1061 std::ostringstream text;
1062 text <<
"cannot add attribute \"" << attribute->get_name() <<
"\" to class \"" <<
p_name <<
"\"\n"
1063 "because the class already has attribute with this name.\n";
1068 lock_file(
"OksClass::add[OksAttribute]");
1071 attribute->p_class =
this;
1080 const char * fname =
"OksClass::swap(const OksAttribute *, const OksAttribute *)";
1085 if(a1 == a2)
return;
1095 std::list<OksAttribute *>::iterator i1 =
p_attributes->end();
1096 std::list<OksAttribute *>::iterator i2 =
p_attributes->end();
1099 if((*i) == a1) i1 = i;
1100 else if((*i) == a2) i2 = i;
1113 lock_file(
"OksClass::swap[OksAttribute]");
1127 const char * fname =
"OksClass::remove(OksAttribute *)";
1130 std::ostringstream text;
1131 text <<
"cannot remove attribute \"" << attribute->get_name() <<
"\" from class \"" <<
p_name <<
"\"\n"
1132 "because the class has no attributes.\n";
1137 if(attribute == *i) {
1138 lock_file(
"OksClass::remove[OksAttribute]");
1154 std::ostringstream text;
1155 text <<
"cannot remove attribute \"" << attribute->get_name() <<
"\" from class \"" <<
p_name <<
"\"\n"
1156 "because the class has no such attribute with this name.\n";
1175 if(p_relationships) {
1176 for(std::list<OksRelationship *>::const_iterator i = p_relationships->begin(); i != p_relationships->end(); ++i)
1177 if(_name == (*i)->get_name())
return *i;
1186 if(p_all_relationships) {
1187 for(std::list<OksRelationship *>::const_iterator i = p_all_relationships->begin(); i != p_all_relationships->end(); ++i)
1188 if(_name == (*i)->get_name())
return *i;
1193 return find_direct_relationship(_name);
1210 const char * fname =
"OksClass::add(OksRelationship *)";
1217 std::ostringstream text;
1218 text <<
"cannot add relationship \"" << relationship->
get_name() <<
"\" to class \"" <<
p_name <<
"\"\n"
1219 "because the class already has relationship with this name.\n";
1224 lock_file(
"OksClass::add[OksRelationship]");
1235 const char * fname =
"OksClass::remove(OksRelationship *)";
1238 std::ostringstream text;
1239 text <<
"cannot remove relationship \"" << relationship->
get_name() <<
"\" from class \"" <<
p_name <<
"\"\n"
1240 "because the class has no relationships.\n";
1245 if(relationship == *i) {
1246 lock_file(
"OksClass::remove[OksRelationship]");
1264 std::ostringstream text;
1265 text <<
"cannot remove relationship \"" << relationship->
get_name() <<
"\" from class \"" <<
p_name <<
"\"\n"
1266 "because the class has no such relationship with this name.\n";
1274 const char * fname =
"OksClass::swap(const OksRelationship *, const OksRelationship *)";
1279 if(r1 == r2)
return;
1293 if((*i) == r1) i1 = i;
1294 else if((*i) == r2) i2 = i;
1306 lock_file(
"OksClass::swap[OksRelationship]");
1333 for(std::list<OksMethod *>::const_iterator i = p_methods->begin(); i != p_methods->end(); ++i)
1334 if(_name == (*i)->get_name())
return *i;
1344 for(std::list<OksMethod *>::const_iterator i = p_all_methods->begin(); i != p_all_methods->end(); ++i)
1345 if(_name == (*i)->get_name())
return *i;
1350 return find_direct_method(_name);
1356 const char * fname =
"OksClass::add(OksMethod *)";
1359 p_methods =
new std::list<OksMethod *>();
1363 std::ostringstream text;
1364 text <<
"cannot add method \"" << method->
get_name() <<
"\" to class \"" <<
p_name <<
"\"\n"
1365 "because the class already has method with this name.\n";
1383 const char * fname =
"OksClass::remove(OksMethod *)";
1386 std::ostringstream text;
1387 text <<
"cannot remove method \"" << method->
get_name() <<
"\" from class \"" <<
p_name <<
"\"\n"
1388 "because the class has no methods.\n";
1392 for(std::list<OksMethod *>::iterator i =
p_methods->begin(); i !=
p_methods->end(); ++i) {
1394 lock_file(
"OksClass::remove[OksMethod]");
1410 std::ostringstream text;
1411 text <<
"cannot remove method \"" << method->
get_name() <<
"\" from class \"" <<
p_name <<
"\"\n"
1412 "because the class has no such method with this name.\n";
1419 const char * fname =
"OksClass::swap(const OksMethod *, const OksMethod *)";
1424 if(m1 == m2)
return;
1434 std::list<OksMethod *>::iterator i1 =
p_methods->end();
1435 std::list<OksMethod *>::iterator i2 =
p_methods->end();
1437 for(std::list<OksMethod *>::iterator i =
p_methods->begin(); i !=
p_methods->end(); ++i) {
1438 if((*i) == m1) i1 = i;
1439 else if((*i) == m2) i2 = i;
1485std::list<OksObject *> *
1488 std::list<OksObject *> * olist = 0;
1493 olist =
new std::list<OksObject *>();
1495 for(OksObject::Map::const_iterator i =
p_objects->begin(); i !=
p_objects->end(); ++i)
1496 olist->push_back((*i).second);
1508 if(!olist) olist =
new std::list<OksObject *>();
1510 for(OksObject::Map::const_iterator i = sc->
p_objects->begin(); i != sc->
p_objects->end(); ++i)
1511 olist->push_back((*i).second);
1523 std::shared_lock lock(p_mutex);
1526 OksObject::Map::const_iterator i = p_objects->find(&
id);
1527 if(i != p_objects->end())
return i->second;
1541 std::unique_lock lock(
p_mutex);
1543 if(!
p_objects->insert(std::pair<const std::string *,OksObject *>(&object->uid.object_id,
object) ).second) {
1551 std::unique_lock lock(
p_mutex);
1557 OksObject::Map::iterator i =
p_objects->find(&object->uid.object_id);
1567 for(OksClass::FList::const_iterator i = clist.begin(); i != clist.end(); ++i) {
1580 c->add_super_classes(clist);
1601 std::ostringstream text;
1605 text <<
" - class \'" << (*i)->get_name() <<
"\'\n";
1625 if(
const FList* scl = c->p_all_super_classes) {
1626 for(FList::const_iterator j = scl->begin(); j != scl->end(); ++j) {
1638 return (v ?
"multi-value" :
"single-value");
1646 static const std::string __enum_str__(
"enum");
1647 static const std::string __string_str__(
"string");
1649 const std::string& s1 = a1->
get_type();
1650 const std::string& s2 = a2->
get_type();
1653 !((s1 == s2) || ((s1 == __enum_str__ && s2 == __string_str__) || (s1 == __string_str__ && s2 == __enum_str__)))
1670 if(c->p_attributes) {
1671 for(std::list<OksAttribute *>::iterator i2 = c->p_attributes->begin(); i2 != c->p_attributes->end(); ++i2) {
1675 if( a1 == 0 && a2 == 0 ) {
1681 "\' overrides one coming from superclass \'" << a->
p_class->
get_name() <<
'\'';
1684 <<
" found attribute \'" << a->
get_name() <<
"\' types conflict in class \'" <<
get_name() <<
"\':\n"
1686 <<
" type of attribute in class \'" <<
get_name() <<
"\' is \'" << a1->
get_type() <<
"\'\n";
1691 <<
" found attribute \'" << a->
get_name() <<
"\' types conflict in class \'" <<
get_name() <<
"\':\n"
1701 <<
" found attribute \'" << a->
get_name() <<
"\' types conflict in class \'" <<
get_name() <<
"\':\n"
1703 <<
" type of attribute in superclass \'" << a2->
p_class->
get_name() <<
"\' is \'" << a2->
get_type() <<
"\'\n";
1708 <<
" found attribute \'" << a->
get_name() <<
"\' types conflict in class \'" <<
get_name() <<
"\':\n"
1743 if(c->p_relationships) {
1744 for(std::list<OksRelationship *>::iterator i2 = c->p_relationships->begin(); i2 != c->p_relationships->end(); ++i2) {
1751 if( r1 == 0 && r2 == 0) {
1757 "\' overrides one coming from superclass \'" << r->p_class->get_name() <<
'\'';
1760 <<
" found relationship \'" << r->get_name() <<
"\' cardinality conflict in class \'" <<
get_name() <<
"\':\n"
1761 <<
" relationship in superclass \'" << r->p_class->get_name() <<
"\' allows " <<
card2string(r->get_high_cardinality_constraint()) <<
"\n"
1767 "\' from superclass \'" << r2->
p_class->
get_name() <<
"\' overrides one coming from superclass \'" << r->p_class->get_name() <<
'\'';
1770 <<
" found relationship \'" << r->get_name() <<
"\' cardinality conflict in class \'" <<
get_name() <<
"\':\n"
1771 <<
" relationship in superclass \'" << r->p_class->get_name() <<
"\' allows " <<
card2string(r->get_high_cardinality_constraint()) <<
"\n"
1785 if(!r->p_class_type) {
1803 std::list<OksMethod *>::iterator i2;
1804 if((*i)->p_methods) {
1805 for(i2 = (*i)->p_methods->begin(); i2 != (*i)->p_methods->end(); ++i2) {
1818 for(std::list<OksMethod *>::iterator i =
p_methods->begin(); i !=
p_methods->end(); ++i) {
1839 if(c->p_objects && !c->p_objects->empty()) {
1840 for(OksObject::Map::const_iterator i2 = c->p_objects->begin(); i2 != c->p_objects->end(); ++i2) {
1846 oldData->
cvt(&newData, a);
1848 memcpy(
static_cast<void *
>(oldData),
static_cast<void *
>(&newData),
sizeof(
OksData));
1852 std::ostringstream text;
1853 text <<
"attribute \'" << a->
get_name() <<
"\' change converting object " << o <<
' ';
1876 if(c->p_objects && !c->p_objects->empty()) {
1877 for(OksObject::Map::const_iterator i2 = c->p_objects->begin(); i2 != c->p_objects->end(); ++i2) {
1884 memcpy(
static_cast<void *
>(oldData),
static_cast<void *
>(&newData),
sizeof(
OksData));
1899 size_t dInfoLength = 0;
1900 bool thereAreChanges =
false;
1905 if(!thereAreChanges) {
1907 if( x ==
p_data_info->end() || x->second->attribute ==
nullptr || x->second->offset != dInfoLength || !(*(x->second->attribute) == *a) ) {
1908 thereAreChanges =
true;
1919 if(!thereAreChanges) {
1920 OksDataInfo::Map::const_iterator x =
p_data_info->find(r->get_name());
1921 if( x ==
p_data_info->end() || x->second->relationship ==
nullptr || x->second->offset != dInfoLength || !(*(x->second->relationship) == *r) ) {
1922 thereAreChanges =
true;
1926 (*dInfo)[r->get_name()] =
new OksDataInfo(dInfoLength++, r);
1930 if(thereAreChanges ==
true) {
1932 for(OksObject::Map::const_iterator i =
p_objects->begin(); i !=
p_objects->end(); ++i) {
1943 if(x !=
p_data_info->end() && x->second->attribute) {
1946 if(*(x->second->attribute) == *a) {
1947 memcpy(
static_cast<void *
>(&data[count++]),
static_cast<void *
>(oldData),
sizeof(
OksData));
1952 oldData->
cvt(&data[count++], a);
1966 OksDataInfo::Map::const_iterator x =
p_data_info->find(r->get_name());
1968 if(x !=
p_data_info->end() && x->second->relationship) {
1971 if(*(x->second->relationship) == *r) {
1972 memcpy(
static_cast<void *
>(&data[count++]),
static_cast<void *
>(oldData),
sizeof(
OksData));
2048 superclasses.push_back(*i2);
2057 switch(changeType) {
2059 c->create_super_classes();
2060 c->create_attributes();
2061 c->create_relationships();
2062 c->create_methods();
2066 c->create_attributes();
2070 c->create_relationships();
2074 c->create_methods();
2088 if(
find(superclasses.begin(), superclasses.end(), *i2) == superclasses.end()) {
2089 superclasses.push_back(*i2);
2092 for(FList::const_iterator i2 = superclasses.begin(); i2 != superclasses.end(); ++i2) {
2097 c->create_sub_classes();
2102 superclasses.clear();
2121 bool found_problems =
false;
2123 if(
const std::list<OksRelationship *> * rels = direct_relationships())
2125 for(
auto & x : *rels)
2127 if(x->get_class_type() ==
nullptr)
2129 if(found_problems ==
false)
2131 found_problems =
true;
2132 out <<
" * there are problems with class \"" << get_name() <<
'\"';
2135 out <<
" from file \"" << get_file()->get_full_file_name() <<
'\"';
2140 out <<
" - class type \"" << x->get_type() <<
"\" of relationship \"" << x->get_name() <<
"\" is not loaded\n";
2145 return found_problems;
static std::string fill(const OksAttribute &a, const OksObject *o, const std::string &reason) noexcept
Failed move item to file.
static std::string fill(const OksClass &c, const std::string &reason) noexcept
static std::string fill(const OksClass &c, const std::string &name) noexcept
static std::string fill(const OksClass &c, const std::string &what, const std::string &reason) noexcept
static std::string fill(const OksClass &c, const std::string &oid, const char *op, const std::string &reason) noexcept
bool get_is_multi_values() const noexcept
const std::string & get_type() const noexcept
Get attribute string type.
const std::string & get_name() const noexcept
out stream operator
void create_super_classes()
OksRelationship * find_direct_relationship(const std::string &name) const noexcept
Find direct relationship.
std::list< std::string * > * p_super_classes
void create_relationships()
size_t number_of_objects() const noexcept
void set_file(OksFile *f, bool update_owner=true)
Move class to different file.
bool check_relationships(std::ostringstream &out, bool print_file_name) const noexcept
OksObject::Map * p_objects
static const char superclass_xml_attr[]
OksClass * find_super_class(const std::string &) const noexcept
OksAttribute * find_direct_attribute(const std::string &name) const noexcept
Find direct attribute.
void add_super_class(const std::string &name)
friend class OksAttribute
static void destroy_list(T list)
OksMethod * find_method(const std::string &name) const noexcept
Find method (search in this and base classes).
std::list< OksMethod * > * p_methods
void registrate_class(bool skip_registered)
FList * p_all_sub_classes
std::list< OksRelationship * > * p_relationships
void(*) ChangeNotifyFN(OksClass *, ChangeType, const void *)
void registrate_instances()
static NotifyFN create_notify_fn
void(*) NotifyFN(OksClass *)
static void destroy_map(T map)
std::list< OksAttribute * > * p_attributes
void add_super_classes(FList *) const
std::string p_description
std::list< OksRelationship * > * p_all_relationships
static const char class_xml_tag[]
bool operator!=(const OksClass &) const
The not equal operator.
OksRelationship * find_relationship(const std::string &name) const noexcept
Find relationship (search in this and base classes).
friend class OksRelationship
static const char description_xml_attr[]
std::list< OksMethod * > * p_all_methods
void swap(const OksAttribute *a1, const OksAttribute *a2)
Swap order of two attributes.
void registrate_class_change(ChangeType, const void *, bool=true)
void add(OksAttribute *a)
Add attribute.
void swap_super_classes(const std::string &c1, const std::string &c2)
Swap order of two superclasses.
std::vector< OksClass * > * p_inheritance_hierarchy
void registrate_relationship_change(OksRelationship *)
void save(OksXmlOutputStream &) const
void set_is_abstract(bool abstract)
Set class abstract property.
OksIndex::Map * p_indices
static NotifyFN delete_notify_fn
static const char is_abstract_xml_attr[]
void remove_super_class(const std::string &name)
const std::string & get_name() const noexcept
OksAttribute * find_attribute(const std::string &name) const noexcept
Find attribute (search in this and base classes).
void remove(const OksAttribute *a)
Remove attribute.
static ChangeNotifyFN change_notify_fn
void set_description(const std::string &description)
Set class description.
std::shared_mutex p_mutex
OksClass * source_class(const OksAttribute *a) const noexcept
Get class owning given attribute.
static const char name_xml_attr[]
bool compare_without_methods(const OksClass &c) const noexcept
OksClass(const std::string &name, OksKernel *kernel, bool transient=false)
Create OKS class.
OksObject * get_object(const std::string &id) const noexcept
Get object by ID.
void k_add(OksAttribute *a)
Kernel method to add attribute.
std::list< OksAttribute * > * p_all_attributes
void registrate_attribute_change(OksAttribute *)
std::list< OksObject * > * create_list_of_all_objects() const noexcept
Get all objects of the class (including derived).
OksDataInfo::Map * p_data_info
void lock_file(const char *)
std::list< OksClass *, boost::fast_pool_allocator< OksClass * > > FList
void k_add_super_class(const std::string &name)
static void destroy(OksClass *c)
Destroy OKS class.
OksMethod * find_direct_method(const std::string &name) const noexcept
Find direct method.
ChangeType
Information about class property changes.
@ ChangeRelationshipsList
bool has_direct_super_class(const std::string &) const noexcept
FList * p_all_super_classes
void create_sub_classes()
Provides interface to the OKS XML schema and data files.
void lock()
Lock OKS file.
Provides interface to the OKS kernel.
bool is_dangling(OksClass *class_ptr) const
Check pointer on oks class.
void k_remove(OksClass *)
std::shared_mutex p_kernel_mutex
OksClass * find_class(const std::string &class_name) const
Find class by name (C++ string).
const std::string & get_name() const noexcept
OksObject describes instance of OksClass.
std::unordered_map< const std::string *, OksObject *, oks::hash_str, oks::equal_str > Map
std::map< const std::string *, OksObject *, SortById > SMap
@ ClassRegistrateInstances
@ ClassRegistrateRelationshipChange
@ ClassRegistrateAttributeChange
@ ClassRegistrateClassChange
const std::string & get_name() const noexcept
CardinalityConstraint get_high_cardinality_constraint() const noexcept
Get relationship high cardinality constraint.
static std::ostream & warning_msg(const char *)
static std::string fill(const char *op, const std::string &reason) noexcept
virtual const char * what() const noexcept
#define OSK_PROFILING(FID, K)
#define TLOG_DEBUG(lvl,...)
const char * bool2str(bool b) noexcept
bool str2bool(const char *s) noexcept
bool cmp_str1(const char *s1, const char s2[2])
static void check_and_report_empty_parameter(const char *fname, bool b1, bool b2)
bool cmp_str4(const char *s1, const char s2[5])
bool cmp_str6(const char *s1, const char s2[7])
bool are_types_different(const OksAttribute *a1, const OksAttribute *a2)
static void check_and_report_found_items(const char *fname, const char *item_type, const std::string &item1_name, const std::string &item2_name, const std::string &class_name, bool b1, bool b2)
bool cmp_str10(const char *s1, const char s2[11])
const char * bool2value_type(bool v)
bool cmp_str9(const char *s1, const char s2[10])
static std::string add_super_class_error(const std::string &c1, const std::string &c2)
const char * card2string(OksRelationship::CardinalityConstraint cc)
void validate_not_empty(const std::string &value, const char *name)
std::ostream & operator<<(std::ostream &s, const oks::exception &ex)
void add_if_not_found(OksClass::FList &clist, OksClass *c)
bool cmp_str11(const char *s1, const char s2[12])
bool cmp_str12(const char *s1, const char s2[13])
static std::string remove_super_class_error(const std::string &c1, const std::string &c2)
FELIX Initialization std::string initerror FELIX queue timed out
Struct OKS data information.
std::map< std::string, OksDataInfo * > Map
Declare map of pointers to OksDataInfo (unsorted by name)
the structure to pass common parameters to various read() methods of OksData and OksObject class
void cvt(OksData *to, const OksAttribute *attr) const
Convert data to new type.
enum dunedaq::oks::OksData::Type type
void ConvertTo(OksData *, const OksRelationship *) const