]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/jaeger-client-cpp/src/jaegertracing/Reference.cpp
2 * Copyright (c) 2017 Uber Technologies, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "jaegertracing/Reference.h"
18 #include "jaegertracing/thrift-gen/jaeger_types.h"
20 namespace jaegertracing
{
21 void Reference::thrift(thrift::SpanRef
& spanRef
) const
24 case Type::ChildOfRef
: {
25 spanRef
.__set_refType(thrift::SpanRefType::CHILD_OF
);
27 case Type::FollowsFromRef
: {
28 spanRef
.__set_refType(thrift::SpanRefType::FOLLOWS_FROM
);
31 std::ostringstream oss
;
32 oss
<< "Invalid span reference type " << static_cast<int>(_type
)
33 << ", context " << _spanContext
;
34 throw std::invalid_argument(oss
.str());
37 spanRef
.__set_traceIdHigh(_spanContext
.traceID().high());
38 spanRef
.__set_traceIdLow(_spanContext
.traceID().low());
39 spanRef
.__set_spanId(_spanContext
.spanID());
41 } // namespace jaegertracing