GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dc_dist_object_base.hpp
1 /**
2  * Copyright (c) 2009 Carnegie Mellon University.
3  * All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an "AS
13  * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14  * express or implied. See the License for the specific language
15  * governing permissions and limitations under the License.
16  *
17  * For more about this software visit:
18  *
19  * http://www.graphlab.ml.cmu.edu
20  *
21  */
22 
23 
24 #ifndef GRAPHLAB_DC_DIST_OBJECT_BASE_HPP
25 #define GRAPHLAB_DC_DIST_OBJECT_BASE_HPP
26 #include <vector>
27 #include <graphlab/rpc/dc_internal_types.hpp>
28 namespace graphlab {
29 
30 namespace dc_impl {
31 /**
32  * \ingroup rpc
33  * \internal
34 Provides an interface for extracting and updating counters from dc_dist_objects
35 */
36 class dc_dist_object_base{
37  public:
38 
39  virtual ~dc_dist_object_base() { }
40 
41  /// Increment the number of calls sent from this object
42  virtual void inc_calls_sent(procid_t source) = 0;
43  /// Increment the number of calls received by this object
44  virtual void inc_calls_received(procid_t dest) = 0;
45 
46  /// Increment the number of bytes sent from this object
47  virtual void inc_bytes_sent(procid_t target, size_t bytes) = 0;
48 
49  /// Return the number of calls received by this object
50  virtual size_t calls_received() const = 0;
51  /// Return the number of calls sent from this object
52  virtual size_t calls_sent() const = 0;
53 };
54 
55 }
56 }
57 
58 #endif
59