Hazelcast C++ Client
Hazelcast C++ Client Library
distributed_object.h
1 /*
2  * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 #pragma once
17 
18 #include "hazelcast/util/export.h"
19 
20 #include <string>
21 #include <boost/thread/future.hpp>
22 
23 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
24 #pragma warning(push)
25 #pragma warning(disable: 4251) //for dll export
26 #pragma warning(disable: 4250) //for warning class1' : inherits 'class2::member' via dominance
27 #endif
28 
29 namespace hazelcast {
30  namespace client {
31  namespace impl {
32  class hazelcast_client_instance_impl;
33  }
34 
50  class HAZELCAST_API distributed_object {
51  friend class impl::hazelcast_client_instance_impl;
52 
53  public:
57  virtual const std::string& get_service_name() const = 0;
58 
64  virtual const std::string& get_name() const = 0;
65 
70  virtual boost::future<void> destroy() = 0;
71 
75  virtual ~distributed_object() = default;
76  };
77 
78  }
79 }
80 
81 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
82 #pragma warning(pop)
83 #endif
84 
Base class for all distributed objects.
virtual const std::string & get_name() const =0
Returns the unique name for this DistributedObject.
virtual boost::future< void > destroy()=0
Destroys this object cluster-wide.
virtual ~distributed_object()=default
Destructor.
virtual const std::string & get_service_name() const =0
Returns the service name for this object.