54 p_class_type (nullptr),
62 bool cm,
bool excl,
bool dp,
const std::string& desc,
OksClass * p) :
72 p_class_type (nullptr),
101 s <<
"Relationship name: \"" << r.p_name <<
"\"\n"
102 " class type: \"" << r.p_rclass <<
"\"\n"
105 " is" << (r.p_composite ==
true ?
"" :
" not") <<
" composite reference\n"
106 " is" << (r.p_exclusive ==
true ?
"" :
" not") <<
" exclusive reference\n"
107 " is " << (r.p_dependent ==
true ?
"dependent" :
"shared") <<
" reference\n"
108 " has description: \"" << r.p_description <<
"\"\n"
109 " is " << (r.p_ordered ==
true ?
"ordered" :
"unordered") << std::endl;
148 p_class_type (nullptr),
171 else if(!strcmp(attr.
name(),
"multi-value-implementation")) {
172 s.error_msg(
"OksRelationship::OksRelationship(OksXmlInputStream&)")
173 <<
"Obsolete oks-relationship\'s attribute \'" << attr.
name() <<
"\'\n";
176 s.throw_unexpected_attribute(attr.
name());
183 catch (std::exception & e) {
194 catch(std::exception& ex) {
205 if(
p_name == new_name)
return;
218 catch(std::exception& ex) {
226 std::ostringstream text;
227 text <<
"Class \"" <<
p_class->
get_name() <<
"\" already has direct relationship \"" << new_name <<
'\"';
272 std::ostringstream text;
273 text <<
"cannot find class \"" << cn <<
'\"';
OksRelationship * find_direct_relationship(const std::string &name) const noexcept
Find direct relationship.
OksRelationship * find_relationship(const std::string &name) const noexcept
Find relationship (search in this and base classes).
void registrate_class_change(ChangeType, const void *, bool=true)
void registrate_relationship_change(OksRelationship *)
const std::string & get_name() const noexcept
void lock_file(const char *)
@ ChangeRelationshipComposite
@ ChangeRelationshipHighCC
@ ChangeRelationshipLowCC
@ ChangeRelationshipClassType
@ ChangeRelationshipDescription
@ ChangeRelationshipExclusive
@ ChangeRelationshipDependent
@ ChangeRelationshipsList
OksClass * find_class(const std::string &class_name) const
Find class by name (C++ string).
void set_type(const std::string &type)
Set relationship type.
static const char class_type_xml_attr[]
void set_is_exclusive(bool exclusive)
Set the composite relationship exclusive property.
static const char ordered_xml_attr[]
static const char low_cc_xml_attr[]
static const char relationship_xml_tag[]
private method to save in XML stream
CardinalityConstraint p_high_cc
static const char description_xml_attr[]
static const char is_composite_xml_attr[]
void set_is_dependent(bool dependent)
Set the composite relationship dependent property.
void set_is_composite(bool composite)
Set the composite relationship property.
void set_high_cardinality_constraint(CardinalityConstraint)
Set relationship high cardinality constraint.
OksRelationship(const std::string &name, OksClass *p=nullptr)
OKS relationship simple constructor.
static const char is_exclusive_xml_attr[]
void save(OksXmlOutputStream &) const
private constructor from XML stream
void set_low_cardinality_constraint(CardinalityConstraint cc)
Set relationship low cardinality constraint.
static const char name_xml_attr[]
static const char * card2str(CardinalityConstraint) noexcept
void set_description(const std::string &description)
Set relationship description.
std::string p_description
static const char high_cc_xml_attr[]
bool operator==(const class OksRelationship &) const
CardinalityConstraint p_low_cc
void set_name(const std::string &)
Set relationship name.
static const char is_dependent_xml_attr[]
static CardinalityConstraint str2card(const char *) noexcept
virtual const char * what() const noexcept
const char * bool2str(bool b) noexcept
bool str2bool(const char *s) noexcept
bool cmp_str1(const char *s1, const char s2[2])
bool cmp_str4(const char *s1, const char s2[5])
bool cmp_str6(const char *s1, const char s2[7])
bool cmp_str10(const char *s1, const char s2[11])
void validate_not_empty(const std::string &value, const char *name)
std::ostream & operator<<(std::ostream &s, const oks::exception &ex)
bool cmp_str11(const char *s1, const char s2[12])
bool cmp_str3(const char *s1, const char s2[4])
bool cmp_str12(const char *s1, const char s2[13])
bool cmp_str7(const char *s1, const char s2[8])