#include <Object.h>
Inheritance diagram for Object:
Public Methods | |
virtual void | add_feature (std::string feature, bool value) |
Note: These functions are typically called by the loading mechanism. | |
virtual void | add_feature (std::string feature, float value) |
virtual void | add_feature (std::string feature, std::string value) |
This variation of add_feature is the only one that doesn't always throw an exception when it reaches Object. | |
virtual void | add_feature (std::string feature, Position value) |
virtual void | add_feature (std::string feature, Object *value) |
std::string | get_text () |
Return the string associated with this Object. | |
virtual | ~Object () |
Protected Methods | |
Object () | |
Private Methods | |
Object (const Object &) | |
Object & | operator= (const Object &) |
Private Attributes | |
std::string | text |
An essential set of functions to understand are the "add_feature" functions. They are used to add descriptive information to the object.
|
00061 {} |
|
00060 {} |
|
|
|
Reimplemented in Drawing, and Group.
00045 { 00046 throw unknown_feature(feature + ": <object/>"); 00047 } |
|
Reimplemented in DrawElement.
00040 { 00041 throw unknown_feature(feature + Utilities::to_string(value)); 00042 } |
|
This variation of add_feature is the only one that doesn't always throw an exception when it reaches Object. If the feature to add is "text", then it sets the text private variable to equal value. Reimplemented in ColorTool, DrawElement, Drawing, and Tool.
00031 { 00032 if (feature == "text") { 00033 text = value; 00034 } else { 00035 throw unknown_feature(feature + ": \"" + value + "\""); 00036 } 00037 } |
|
Reimplemented in Circle, Drawing, and Rectangle.
00021 { 00022 throw unknown_feature(feature + ": " + Utilities::to_string(value)); 00023 } |
|
Note: These functions are typically called by the loading mechanism. The following three functions are typically executed when the load file contains a feature that is not recognized. That is why they thow an exception. In other words, the logic behind this method is: if execution has reached THIS point, whatever the feature is, it's not recognized. The exception to this rule is add_feature(string,string).
00016 { 00017 throw unknown_feature(feature + ": " + Utilities::to_string(value)); 00018 } |
|
Return the string associated with this Object.
00054 { 00055 00056 return text; 00057 } |
|
|
|
|