summaryrefslogtreecommitdiff
path: root/cpp/src/IceStorm/Util.h
blob: 22c1cbabccb45247d90a18b85ac9192a3be32155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

#ifndef UTIL_H
#define UTIL_H

#include <Ice/Ice.h>
#include <IceDB/IceDB.h>
#include <IceStorm/LLURecord.h>
#include <IceStorm/SubscriberRecord.h>

namespace IceStorm
{

//
// Forward declarations.
//
class Instance;

using SubscriberMap = IceDB::Dbi<IceStorm::SubscriberRecordKey,
                                 IceStorm::SubscriberRecord,
                                 IceDB::IceContext,
                                 Ice::OutputStream>;
using LLUMap = IceDB::Dbi<std::string, IceStormElection::LogUpdate, IceDB::IceContext, Ice::OutputStream>;

const std::string lluDbKey = "_manager";

}

namespace IceStormInternal
{

std::string
identityToTopicName(const Ice::Identity&);

Ice::Identity
nameToIdentity(const std::shared_ptr<IceStorm::Instance>&, const std::string&);

std::string
describeEndpoints(const std::shared_ptr<Ice::ObjectPrx>&);

int
compareSubscriberRecordKey(const MDB_val* v1, const MDB_val* v2);

IceStormElection::LogUpdate
getIncrementedLLU(const IceDB::ReadWriteTxn&, IceStorm::LLUMap&);

}

#endif