| 111 | } |
| 112 | |
| 113 | bool RowData::push_annotation(Annotation *a) |
| 114 | { |
| 115 | assert(a); |
| 116 | |
| 117 | std::lock_guard<std::mutex> lock(_global_visitor_mutex); |
| 118 | |
| 119 | try { |
| 120 | _annotations.push_back(a); |
| 121 | _item_count = _annotations.size(); |
| 122 | _max_annotation = max(_max_annotation, a->end_sample() - a->start_sample()); |
| 123 | |
| 124 | if (a->end_sample() != a->start_sample()){ |
| 125 | if (_min_annotation == 0){ |
| 126 | _min_annotation = a->end_sample() - a->start_sample(); |
| 127 | } |
| 128 | else{ |
| 129 | _min_annotation = min(_min_annotation, a->end_sample() - a->start_sample()); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | return true; |
| 134 | |
| 135 | } catch (const std::bad_alloc&) { |
| 136 | return false; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | |
| 141 | bool RowData::get_annotation(Annotation *ann, uint64_t index) |
no test coverage detected