summaryrefslogtreecommitdiff
path: root/cpp/src/IceStorm/TransientTopicManagerI.h
blob: 5582459547523d18981a45bdb4cfca08ae022206 (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
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

#ifndef TRANSIENT_TOPIC_MANAGER_I_H
#define TRANSIENT_TOPIC_MANAGER_I_H

#include <IceStorm/IceStormInternal.h>

namespace IceStorm
{

class Instance;
class TransientTopicImpl;

class TransientTopicManagerImpl final : public TopicManagerInternal
{
public:

    TransientTopicManagerImpl(std::shared_ptr<Instance>);

    // TopicManager methods.
    std::shared_ptr<TopicPrx> create(std::string, const Ice::Current&) override;
    std::shared_ptr<TopicPrx> retrieve(std::string, const Ice::Current&) override;
    TopicDict retrieveAll(const Ice::Current&) override;
    std::shared_ptr<IceStormElection::NodePrx> getReplicaNode(const Ice::Current&) const override;

    void reap();
    void shutdown();

private:

    const std::shared_ptr<Instance> _instance;
    std::map<std::string, std::shared_ptr<TransientTopicImpl>> _topics;

    std::mutex _mutex;
};

} // End namespace IceStorm

#endif