MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / Circle

Class Circle

examples/src/json_traits_polymorphic_examples.cpp:87–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 };
86
87 class Circle : public Shape
88 {
89 double radius_;
90
91 public:
92 Circle(double radius)
93 : radius_(radius)
94 {
95 }
96
97 const std::string& type() const
98 {
99 static const std::string type_ = "circle";
100 return type_;
101 }
102
103 double radius() const
104 {
105 return radius_;
106 }
107
108 double area() const override
109 {
110 constexpr double pi = 3.14159265358979323846;
111 return pi*radius_*radius_;
112 }
113 };
114
115} // namespace ns
116} // namespace

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected