Date::Date(int _year, int _month, int _day) :m_Year(_year), m_Month(_month), m_Day(_day) { if (!isValide()) throw std::logic_error("Error: date is not valid!"); }
bool AttributeValues::isValid(unsigned int prop, Enums::DataType type, void *value) { switch (type) { case Enums::ENUM: return isValide((EnumProperty)prop, *(int *)value); break; case Enums::INT: return isValidi((IntProperty)prop, *(int *)value); break; case Enums::IVEC2: return isValidi2((Int2Property)prop, *(ivec2 *)value); break; case Enums::UINT: return isValidui((UIntProperty)prop, *(unsigned int *)value); break; case Enums::UIVEC2: return isValidui2((UInt2Property)prop, *(uivec2 *)value); break; case Enums::UIVEC3: return isValidui3((UInt3Property)prop, *(uivec3 *)value); break; case Enums::BOOL: return isValidb((BoolProperty)prop, *(bool *)value); break; case Enums::BVEC4: return isValidb4((Bool4Property)prop, *(bvec4 *)value); break; case Enums::FLOAT: return isValidf((FloatProperty)prop, *(float *)value); break; case Enums::VEC2: return isValidf2((Float2Property)prop, *(vec2 *)value); break; case Enums::VEC3: return isValidf3((Float3Property)prop, *(vec3 *)value); break; case Enums::VEC4: return isValidf4((Float4Property)prop, *(vec4 *)value); break; case Enums::MAT4: return isValidm4((Mat4Property)prop, *(mat4 *)value); break; case Enums::MAT3: return isValidm3((Mat3Property)prop, *(mat3 *)value); break; default: assert(false && "Missing Data Type in class attributeValues or Invalid prop"); return false; } }
void AttributeValues::setPrope(EnumProperty prop, int value) { assert(isValide(prop,value)); m_EnumProps[prop] = value; }
Time::Time(const int _hour, const int _minutes) :m_hour(_hour), m_minutes(_minutes){ if (!isValide()) throw std::logic_error("Error: time is not correct."); }