forked from xR3b0rn/dbcppp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttributeImpl.cpp
More file actions
49 lines (46 loc) · 1.24 KB
/
AttributeImpl.cpp
File metadata and controls
49 lines (46 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "AttributeImpl.h"
#include "../../include/dbcppp/Network.h"
using namespace dbcppp;
std::unique_ptr<IAttribute> IAttribute::Create(
std::string&& name
, IAttributeDefinition::EObjectType object_type
, value_t value)
{
return std::make_unique<AttributeImpl>(
std::move(name)
, object_type
, std::move(value));
}
AttributeImpl::AttributeImpl(std::string&& name, IAttributeDefinition::EObjectType object_type, IAttribute::value_t value)
: _name(std::move(name))
, _object_type(std::move(object_type))
, _value(std::move(value))
{}
std::unique_ptr<IAttribute> AttributeImpl::Clone() const
{
return std::make_unique<AttributeImpl>(*this);
}
const std::string& AttributeImpl::Name() const
{
return _name;
}
IAttributeDefinition::EObjectType AttributeImpl::ObjectType() const
{
return _object_type;
};
const IAttribute::value_t& AttributeImpl::Value() const
{
return _value;
}
bool AttributeImpl::operator==(const IAttribute& rhs) const
{
bool result = true;
result &= _name == rhs.Name();
result &= _object_type == rhs.ObjectType();
result &= _value == rhs.Value();
return result;
}
bool AttributeImpl::operator!=(const IAttribute& rhs) const
{
return !(*this == rhs);
}