attribute.cpp 594 B

123456789101112131415161718192021222324252627282930
  1. #if defined(Hiro_Attribute)
  2. Attribute::Attribute(const string& name, const any& value) {
  3. state.name = name;
  4. state.value = value;
  5. }
  6. auto Attribute::operator==(const Attribute& source) const -> bool {
  7. return state.name == source.state.name;
  8. }
  9. auto Attribute::operator<(const Attribute& source) const -> bool {
  10. return state.name < source.state.name;
  11. }
  12. auto Attribute::name() const -> string {
  13. return state.name;
  14. }
  15. auto Attribute::setValue(const any& value) -> type& {
  16. state.value = value;
  17. return *this;
  18. }
  19. auto Attribute::value() const -> any& {
  20. return state.value;
  21. }
  22. #endif