@@ -126,6 +126,7 @@ struct Annotation::Impl {
126
126
std::vector<Variant> m_metadata_values;
127
127
int m_opt;
128
128
std::atomic<int > m_refcount;
129
+
129
130
Impl (const std::string& name, MetadataListType metadata, int opt)
130
131
: m_attr(nullptr ),
131
132
m_name (name),
@@ -151,17 +152,18 @@ struct Annotation::Impl {
151
152
~Impl () {
152
153
delete m_attr.load ();
153
154
}
155
+
154
156
void begin (const Variant& data) {
155
157
Caliper c;
156
- Attribute attr = get_attribute (c, data.type (), m_metadata_keys, m_metadata_values );
158
+ Attribute attr = get_attribute (c, data.type ());
157
159
158
160
if ((attr.type () == data.type ()) && attr.type () != CALI_TYPE_INV)
159
161
c.begin (attr, data);
160
162
}
161
163
162
164
void set (const Variant& data) {
163
165
Caliper c;
164
- Attribute attr = get_attribute (c, data.type (), m_metadata_keys, m_metadata_values );
166
+ Attribute attr = get_attribute (c, data.type ());
165
167
166
168
if ((attr.type () == data.type ()) && attr.type () != CALI_TYPE_INV)
167
169
c.set (attr, data);
@@ -173,13 +175,13 @@ struct Annotation::Impl {
173
175
c.end (get_attribute (c));
174
176
}
175
177
176
- Attribute get_attribute (Caliper& c, cali_attr_type type = CALI_TYPE_INV, const std::vector<cali::Attribute>& attrs = {}, const std::vector<cali::Variant>& values = {} ) {
178
+ Attribute get_attribute (Caliper& c, cali_attr_type type = CALI_TYPE_INV) {
177
179
Attribute* attr_p = m_attr.load ();
178
180
179
181
if (!attr_p) {
180
182
Attribute* new_attr = type == CALI_TYPE_INV ?
181
183
new Attribute (c.get_attribute (m_name)) :
182
- new Attribute (c.create_attribute (m_name, type, m_opt,attrs .size (),attrs .data (),values .data ()));
184
+ new Attribute (c.create_attribute (m_name, type, m_opt, m_metadata_keys .size (), m_metadata_keys .data (), m_metadata_values .data ()));
183
185
184
186
// Don't store invalid attribute in shared pointer
185
187
if (*new_attr == Attribute::invalid)
@@ -281,16 +283,6 @@ Annotation& Annotation::begin(double data)
281
283
return begin (Variant (data));
282
284
}
283
285
284
- Annotation& Annotation::begin (const char * data)
285
- {
286
- return begin (Variant (data));
287
- }
288
-
289
- Annotation& Annotation::begin (cali_attr_type type, void * data, uint64_t size)
290
- {
291
- return begin (Variant (type, data, size));
292
- }
293
-
294
286
Annotation& Annotation::begin (const Variant& data)
295
287
{
296
288
pI->begin (data);
@@ -319,7 +311,7 @@ Annotation& Annotation::set(double data)
319
311
320
312
Annotation& Annotation::set (const char * data)
321
313
{
322
- return set (Variant (CALI_TYPE_STRING, data, strlen (data) ));
314
+ return set (Variant (data));
323
315
}
324
316
325
317
Annotation& Annotation::set (cali_attr_type type, void * data, uint64_t size)
0 commit comments