SST/macro
diamond.h
Go to the documentation of this file.
1 #include "gem.h"
2 #include "mineral.h"
3 
4 namespace sstmac {
5 namespace tutorial {
6 
7 class diamond :
8  public gem,
9  public mineral
10 {
11  /** Public typedefs */
12  public:
15 
16  /** Public functions and constructors */
17  public:
18  diamond(num_carats)
19  : num_carats_(num_carats) {
20  }
21 
22  /** Fill out ptr_type virtual interface */
23  std::string
24  to_string() const {
25  return "diamond";
26  }
27 
28  int
29  value() const {
30  return num_carats_ * 100;
31  }
32 
33  std::string
34  structure() const {
35  return "tetrahedral carbon";
36  }
37 
38  /** Member variables */
39  protected:
41 };
42 
43 }
44 }
45 
std::string structure() const
Public functions and constructors.
Definition: diamond.h:34
diamond(num_carats)
Public functions and constructors.
Definition: diamond.h:18
The gem class.
Definition: gem.h:9
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
sprockit::refcount_ptr< const diamond > const_ptr
Definition: diamond.h:14
int num_carats_
Member variables.
Definition: diamond.h:40
sprockit::refcount_ptr< diamond > ptr
Public typedefs.
Definition: diamond.h:13
The mineral class.
Definition: mineral.h:9
std::string to_string() const
Fill out ptr_type virtual interface.
Definition: diamond.h:24
int value() const
Public functions and constructors.
Definition: diamond.h:29