Calculator  Step 6
Public Member Functions | Private Member Functions | List of all members
number_void Class Reference

#include <number_impl.hpp>

Inheritance diagram for number_void:
number_impl

Public Member Functions

 number_void ()
 
- Public Member Functions inherited from number_impl
virtual ~number_impl ()
 
void print (std::ostream &stream) const
 
std::string to_string () const
 
void save (std::ostream &stream) const
 
bool equals (number_impl const &rhs) const
 
bool less (number_impl const &rhs) const
 
std::shared_ptr< number_impladd (number_impl const &rhs)
 
std::shared_ptr< number_implsubtract (number_impl const &rhs)
 
std::shared_ptr< number_implmultiply (number_impl const &rhs)
 
std::shared_ptr< number_impldivide (number_impl const &rhs)
 
void add_ref ()
 
void del_ref ()
 
std::shared_ptr< number_implpromote (number_impl &rhs) const
 
virtual std::shared_ptr
< number_impl
promote_to_void ()
 
virtual std::shared_ptr
< number_impl
promote_to_long ()
 
virtual std::shared_ptr
< number_impl
promote_to_rational ()
 
virtual std::shared_ptr
< number_impl
promote_to_double ()
 

Private Member Functions

virtual std::string do_to_string () const
 
virtual void do_save (std::ostream &stream) const
 
virtual bool do_equals (number_impl const &rhs) const
 
virtual bool do_less (number_impl const &rhs) const
 
virtual std::shared_ptr
< number_impl
do_add (number_impl const &rhs)
 
virtual std::shared_ptr
< number_impl
do_subtract (number_impl const &rhs)
 
virtual std::shared_ptr
< number_impl
do_multiply (number_impl const &rhs)
 
virtual std::shared_ptr
< number_impl
do_divide (number_impl const &rhs)
 
virtual std::shared_ptr
< number_impl
do_promote (number_impl &rhs) const
 

Additional Inherited Members

- Static Public Member Functions inherited from number_impl
static std::shared_ptr
< number_impl
read_library (std::istream &stream)
 
- Protected Member Functions inherited from number_impl
 number_impl ()
 

Detailed Description

Represent a number without a type. A void number cannot be converted into any other type, but any type can be converted to void.

Definition at line 80 of file number_impl.hpp.

Constructor & Destructor Documentation

number_void::number_void ( )
inline

Definition at line 82 of file number_impl.hpp.

82 : number_impl() {}

Member Function Documentation

std::shared_ptr< number_impl > number_void::do_add ( number_impl const &  rhs)
privatevirtual

Implements number_impl.

Definition at line 146 of file number_impl.cpp.

147 {
148  return shared_from_this();
149 }
std::shared_ptr< number_impl > number_void::do_divide ( number_impl const &  rhs)
privatevirtual

Implements number_impl.

Definition at line 161 of file number_impl.cpp.

162 {
163  return shared_from_this();
164 }
bool number_void::do_equals ( number_impl const &  rhs) const
privatevirtual

Implements number_impl.

Definition at line 132 of file number_impl.cpp.

134 {
135  return false;
136 }
bool number_void::do_less ( number_impl const &  rhs) const
privatevirtual

Implements number_impl.

Definition at line 139 of file number_impl.cpp.

141 {
142  return false;
143 }
std::shared_ptr< number_impl > number_void::do_multiply ( number_impl const &  rhs)
privatevirtual

Implements number_impl.

Definition at line 156 of file number_impl.cpp.

157 {
158  return shared_from_this();
159 }
std::shared_ptr< number_impl > number_void::do_promote ( number_impl rhs) const
privatevirtual

Implements number_impl.

Definition at line 166 of file number_impl.cpp.

References number_impl::promote_to_void().

168 {
169  return rhs.promote_to_void();
170 }
virtual std::shared_ptr< number_impl > promote_to_void()
Definition: number_impl.cpp:97
void number_void::do_save ( std::ostream &  stream) const
privatevirtual

Implements number_impl.

Definition at line 125 of file number_impl.cpp.

127 {
128  stream << "void ";
129 }
std::shared_ptr< number_impl > number_void::do_subtract ( number_impl const &  rhs)
privatevirtual

Implements number_impl.

Definition at line 151 of file number_impl.cpp.

152 {
153  return shared_from_this();
154 }
std::string number_void::do_to_string ( ) const
privatevirtual

Implements number_impl.

Definition at line 119 of file number_impl.cpp.

121 {
122  return std::string{};
123 }

The documentation for this class was generated from the following files: