3
3
#include < memory>
4
4
#include < string>
5
5
#include < vector>
6
- #include < unordered_map>
6
+
7
+ namespace Ydb {
8
+ class TOperationId ;
9
+ }
7
10
8
11
namespace NKikimr {
9
12
namespace NOperationId {
10
13
11
14
class TOperationId {
12
- static constexpr int kEKindMinValue = 0 ;
13
- static constexpr int kEKindMaxValue = 10 ;
14
15
public:
15
16
enum EKind : int {
16
17
UNUSED = 0 ,
@@ -31,40 +32,38 @@ class TOperationId {
31
32
std::string Value;
32
33
};
33
34
34
- using TDataList = std::vector<std::unique_ptr<TData>>;
35
-
36
35
TOperationId ();
37
36
explicit TOperationId (const std::string& string, bool allowEmpty = false );
38
-
37
+
39
38
TOperationId (const TOperationId& other);
40
- TOperationId (TOperationId&& other) = default ;
39
+ TOperationId (TOperationId&& other);
41
40
42
41
TOperationId& operator =(const TOperationId& other);
43
- TOperationId& operator =(TOperationId&& other) = default ;
42
+ TOperationId& operator =(TOperationId&& other);
44
43
45
- ~TOperationId () = default ;
44
+ ~TOperationId ();
46
45
47
46
EKind GetKind () const ;
48
47
void SetKind (const EKind& kind);
49
48
50
- const TDataList& GetData () const ;
51
- TDataList& GetMutableData ();
49
+ std::vector<TData> GetData () const ;
52
50
51
+ void AddOptionalValue (const std::string& key, const std::string& value);
53
52
const std::vector<const std::string*>& GetValue (const std::string& key) const ;
53
+
54
54
std::string GetSubKind () const ;
55
55
std::string ToString () const ;
56
56
57
+ const Ydb::TOperationId& GetProto () const ;
57
58
private:
58
- bool IsValidKind (int kind);
59
- void CopyData (const TOperationId::TDataList& otherData);
60
-
61
- EKind Kind;
62
- TDataList Data;
63
- std::unordered_map<std::string, std::vector<const std::string*>> Index;
59
+ class TImpl ;
60
+ std::unique_ptr<TImpl> Impl;
64
61
};
65
62
66
- void AddOptionalValue (TOperationId& operarionId, const std::string& key, const std::string& value);
67
- void AddOptionalValue (TOperationId& operarionId, const std::string& key, const char * value, size_t size);
63
+ std::string ProtoToString (const Ydb::TOperationId& proto);
64
+
65
+ void AddOptionalValue (Ydb::TOperationId& operarionId, const std::string& key, const std::string& value);
66
+
68
67
TOperationId::EKind ParseKind (const std::string_view value);
69
68
70
69
std::string FormatPreparedQueryIdCompat (const std::string& str);
0 commit comments