CXXGraph  0.4.0
CXXGraph is a header only, that manages the Graphs and it's algorithm in C++
Weighted.hpp
1 /***********************************************************/
2 /*** ______ ____ ______ _ ***/
3 /*** / ___\ \/ /\ \/ / ___|_ __ __ _ _ __ | |__ ***/
4 /*** | | \ / \ / | _| '__/ _` | '_ \| '_ \ ***/
5 /*** | |___ / \ / \ |_| | | | (_| | |_) | | | | ***/
6 /*** \____/_/\_\/_/\_\____|_| \__,_| .__/|_| |_| ***/
7 /*** |_| ***/
8 /***********************************************************/
9 /*** Header-Only C++ Library for Graph ***/
10 /*** Representation and Algorithms ***/
11 /***********************************************************/
12 /*** Author: ZigRazor ***/
13 /*** E-Mail: zigrazor@gmail.com ***/
14 /***********************************************************/
15 /*** Collaboration: ----------- ***/
16 /***********************************************************/
17 /*** License: AGPL v3.0 ***/
18 /***********************************************************/
19 
20 #ifndef __CXXGRAPH_WEIGHTED_H__
21 #define __CXXGRAPH_WEIGHTED_H__
22 
23 #pragma once
24 
25 namespace CXXGRAPH
26 {
27  class Weighted
28  {
29  private:
30  double weight = 0.0;
31 
32  public:
33  Weighted();
34  Weighted(const double weight);
35  virtual ~Weighted() = default;
36  double getWeight() const;
37  void setWeight(const double weight);
38  };
39 
40  //inline because the implementation of non-template function in header file
41  inline Weighted::Weighted()
42  {
43  weight = 0.0;
44  }
45 
46  //inline because the implementation of non-template function in header file
47  inline Weighted::Weighted(const double weight)
48  {
49  this->weight = weight;
50  }
51 
52  //inline because the implementation of non-template function in header file
53  inline double Weighted::getWeight() const
54  {
55  return weight;
56  }
57 
58  //inline because the implementation of non-template function in header file
59  inline void Weighted::setWeight(const double weight)
60  {
61  this->weight = weight;
62  }
63 
64 }
65 
66 
67 #endif // __CXXGRAPH_WEIGHTED_H__
Definition: Weighted.hpp:28