@@ -16,38 +16,37 @@ ArchiveLocation::ArchiveLocation(Archive& context,
16
16
: context_(context),
17
17
statement_ (statement),
18
18
registration_(registration),
19
- primary_key_(name),
20
- current_class_(registration.GetClassName()) {}
19
+ primary_key_(name) {}
21
20
22
21
PrimaryKey ArchiveLocation::GetPrimaryKey () const {
23
22
return primary_key_;
24
23
}
25
24
26
- bool ArchiveLocation::Write (ArchiveDef::Member member,
25
+ bool ArchiveLocation::Write (const std::string& member,
27
26
const std::string& item) {
28
- auto index = registration_.FindColumnIndex (current_class_, member);
27
+ auto index = registration_.FindColumnIndex (member);
29
28
return index .has_value () ? statement_.WriteValue (index .value (), item) : false ;
30
29
}
31
30
32
- bool ArchiveLocation::WriteIntegral (ArchiveDef::Member member, int64_t item) {
33
- auto index = registration_.FindColumnIndex (current_class_, member);
31
+ bool ArchiveLocation::WriteIntegral (const std::string& member, int64_t item) {
32
+ auto index = registration_.FindColumnIndex (member);
34
33
return index .has_value () ? statement_.WriteValue (index .value (), item) : false ;
35
34
}
36
35
37
- bool ArchiveLocation::Write (ArchiveDef::Member member, double item) {
38
- auto index = registration_.FindColumnIndex (current_class_, member);
36
+ bool ArchiveLocation::Write (const std::string& member, double item) {
37
+ auto index = registration_.FindColumnIndex (member);
39
38
return index .has_value () ? statement_.WriteValue (index .value (), item) : false ;
40
39
}
41
40
42
- bool ArchiveLocation::Write (ArchiveDef::Member member, const Allocation& item) {
43
- auto index = registration_.FindColumnIndex (current_class_, member);
41
+ bool ArchiveLocation::Write (const std::string& member, const Allocation& item) {
42
+ auto index = registration_.FindColumnIndex (member);
44
43
return index .has_value () ? statement_.WriteValue (index .value (), item) : false ;
45
44
}
46
45
47
- bool ArchiveLocation::Write (ArchiveDef::Member member,
46
+ bool ArchiveLocation::Write (const std::string& member,
48
47
const ArchiveDef& otherDef,
49
48
const Archivable& other) {
50
- auto index = registration_.FindColumnIndex (current_class_, member);
49
+ auto index = registration_.FindColumnIndex (member);
51
50
52
51
if (!index .has_value ()) {
53
52
return false ;
@@ -76,13 +75,13 @@ bool ArchiveLocation::Write(ArchiveDef::Member member,
76
75
std::optional<int64_t > ArchiveLocation::WriteVectorKeys (
77
76
std::vector<int64_t >&& members) {
78
77
ArchiveVector vector (std::move (members));
79
- return context_.ArchiveInstance (ArchiveVector::ArchiveDefinition , vector);
78
+ return context_.ArchiveInstance (ArchiveVector::kArchiveDefinition , vector);
80
79
}
81
80
82
81
bool ArchiveLocation::ReadVectorKeys (PrimaryKey name,
83
82
std::vector<int64_t >& members) {
84
83
ArchiveVector vector;
85
- if (!context_.UnarchiveInstance (ArchiveVector::ArchiveDefinition , name,
84
+ if (!context_.UnarchiveInstance (ArchiveVector::kArchiveDefinition , name,
86
85
vector)) {
87
86
return false ;
88
87
}
@@ -91,30 +90,30 @@ bool ArchiveLocation::ReadVectorKeys(PrimaryKey name,
91
90
return true ;
92
91
}
93
92
94
- bool ArchiveLocation::Read (ArchiveDef::Member member, std::string& item) {
95
- auto index = registration_.FindColumnIndex (current_class_, member);
93
+ bool ArchiveLocation::Read (const std::string& member, std::string& item) {
94
+ auto index = registration_.FindColumnIndex (member);
96
95
return index .has_value () ? statement_.ReadValue (index .value (), item) : false ;
97
96
}
98
97
99
- bool ArchiveLocation::ReadIntegral (ArchiveDef::Member member, int64_t & item) {
100
- auto index = registration_.FindColumnIndex (current_class_, member);
98
+ bool ArchiveLocation::ReadIntegral (const std::string& member, int64_t & item) {
99
+ auto index = registration_.FindColumnIndex (member);
101
100
return index .has_value () ? statement_.ReadValue (index .value (), item) : false ;
102
101
}
103
102
104
- bool ArchiveLocation::Read (ArchiveDef::Member member, double & item) {
105
- auto index = registration_.FindColumnIndex (current_class_, member);
103
+ bool ArchiveLocation::Read (const std::string& member, double & item) {
104
+ auto index = registration_.FindColumnIndex (member);
106
105
return index .has_value () ? statement_.ReadValue (index .value (), item) : false ;
107
106
}
108
107
109
- bool ArchiveLocation::Read (ArchiveDef::Member member, Allocation& item) {
110
- auto index = registration_.FindColumnIndex (current_class_, member);
108
+ bool ArchiveLocation::Read (const std::string& member, Allocation& item) {
109
+ auto index = registration_.FindColumnIndex (member);
111
110
return index .has_value () ? statement_.ReadValue (index .value (), item) : false ;
112
111
}
113
112
114
- bool ArchiveLocation::Read (ArchiveDef::Member member,
113
+ bool ArchiveLocation::Read (const std::string& member,
115
114
const ArchiveDef& otherDef,
116
115
Archivable& other) {
117
- auto index = registration_.FindColumnIndex (current_class_, member);
116
+ auto index = registration_.FindColumnIndex (member);
118
117
119
118
/*
120
119
* Make sure a member is present at that column
0 commit comments