1 // 2 // Copyright (c) ZeroC, Inc. All rights reserved. 3 // 4 5 #ifndef UTIL_H 6 #define UTIL_H 7 8 #include <Ice/Ice.h> 9 #include <IceDB/IceDB.h> 10 #include <IceStorm/LLURecord.h> 11 #include <IceStorm/SubscriberRecord.h> 12 13 namespace IceStorm 14 { 15 16 // 17 // Forward declarations. 18 // 19 class Instance; 20 typedef IceUtil::Handle<Instance> InstancePtr; 21 22 typedef IceDB::Dbi<IceStorm::SubscriberRecordKey, IceStorm::SubscriberRecord, IceDB::IceContext, Ice::OutputStream> 23 SubscriberMap; 24 typedef IceDB::Dbi<std::string, IceStormElection::LogUpdate, IceDB::IceContext, Ice::OutputStream> LLUMap; 25 26 const std::string lluDbKey = "_manager"; 27 28 } 29 30 namespace IceStormInternal 31 { 32 33 std::string 34 identityToTopicName(const Ice::Identity&); 35 36 Ice::Identity 37 nameToIdentity(const IceStorm::InstancePtr&, const std::string&); 38 39 std::string 40 describeEndpoints(const Ice::ObjectPrx&); 41 42 int 43 compareSubscriberRecordKey(const MDB_val* v1, const MDB_val* v2); 44 45 IceStormElection::LogUpdate 46 getIncrementedLLU(const IceDB::ReadWriteTxn&, IceStorm::LLUMap&); 47 48 } 49 50 #endif 51