#include <object_base.h>
Inherited by address_base [virtual], application_base [virtual], basic_window [virtual], blowfish_crypto [virtual], buffer_base [virtual], bug_finder< contents > [virtual], byte_array [virtual], chaos [virtual], command_parameter [virtual], configlet [virtual], configurable [virtual], configuration_list [virtual], cromp_common [virtual], database_login_info, db_contents, driven_objects_list [virtual], geometric::point< numeric_type > [virtual], global_live_objects [virtual], hashing_algorithm [virtual], heartbeat [virtual], ice_key [virtual], infoton [virtual], int_set [virtual], istring_object [virtual], ithread [virtual], life_maintainer [virtual], living_item [virtual], log_base [virtual], machine_uid_array [virtual], menu_common_base [virtual], mutex [virtual], nodes::safe_list [virtual], occurrence [virtual], octopus [virtual], geometric::point< double > [virtual], geometric::point< int > [virtual], process_control [virtual], raw_socket [virtual], rendezvous [virtual], RSA_crypto [virtual], schedulable [virtual], scheduling_common [virtual], sequence_tracker [virtual], service_root [virtual], shared_memory [virtual], shutdown_alerter [virtual], socket_minder [virtual], spocket [virtual], ssl_init [virtual], state_machine [virtual], stdio_redirecter [virtual], string_array [virtual], string_set [virtual], system_values [virtual], tcpip_stack [virtual], tentacle [virtual], timer_driver [virtual], tokenizer [virtual], transition_map [virtual], version [virtual], version_checker [virtual], version_ini [virtual], version_record [virtual], and zing_table [virtual].
Public Member Functions | |
| virtual | ~object_base () |
| requires a virtual destructor. | |
| virtual const char * | class_name () const =0 |
| Returns the bare name of this class as a constant character pointer. | |
| virtual istring | instance_name () const |
| This returns information about this specific instance of the object. | |
| virtual istring | text_form () const |
| Provides a text view of all the important info owned by this object. | |
| template<class a, class b> | |
| int | types_are_equal (a one, b two) |
| a short-hand for checking that two objects have the same type. | |
| virtual bool | is_equal (const object_base &formal(compare_with)) const |
| Compares two object_bases for equality. | |
This base class is not required in any sense, but it at least provides a primary virtual root (aiding in design of derived polymorphic objects) and guarantees users that a compliant class offers some basic services. It can be used as a virtual base class to support multiple inheritance. The most derived object must always implement the methods itself, even if inherited objects have also provided implementations. Other base classes are provided in this file as well, such as the clonable base class and the synchronizer_base class.
Definition at line 34 of file object_base.h.
| virtual object_base::~object_base | ( | ) | [inline, virtual] |
| virtual const char* object_base::class_name | ( | ) | const [pure virtual] |
Returns the bare name of this class as a constant character pointer.
The name returned here is supposed to be just a class name and not provide any more information than that (see instance_name() if you need to return specific class member info).
Referenced by blowfish_crypto::decrypt(), cromp_client::enable_encryption(), cromp_server::enable_servers(), blowfish_crypto::encrypt(), instance_name(), tiny_shell::OnClose(), octopus::remove_tentacle(), infoton::set_classifier(), and version_checker::text_form().
| virtual istring object_base::instance_name | ( | ) | const [inline, virtual] |
This returns information about this specific instance of the object.
By default, it just returns the class name. It can be overridden to provide more information about the object. One intention of this function is to offer a unique name for this object, compared to the generic class_name(). This is not supposed to be so wordy as the text_form() method.
Definition at line 45 of file object_base.h.
References class_name().
Referenced by cromp_client::asynch_connect(), and static_memory_gremlin::put().
| virtual istring object_base::text_form | ( | ) | const [inline, virtual] |
Provides a text view of all the important info owned by this object.
It is understood that there could be a large amount of information and that this function might take a relatively long time to complete. The information can be provided in multiple lines if desired (it is good to use log_base::platform_ending() for the line breaks to help to ensure that the text is formatted appropriately). the default is quite lame and should be overridden.
Reimplemented in buffer, buffer_base, linked_buffer, connection, zingable, internet_address, serial_port_address, ipc_address, address_base, machine_uid_array, socket_minder, string_array, version_checker, version, version_record, geometric::point< numeric_type >, attribute_bundle, menu_base, system_values, file_transfer_tentacle, tokenizer, geometric::point< double >, and geometric::point< int >.
Definition at line 53 of file object_base.h.
Referenced by cromp_client::enable_encryption(), octopus::evaluate(), cromp_client::synchronous_request(), and cromp_server::wrap_infoton().
| int object_base::types_are_equal | ( | a | one, | |
| b | two | |||
| ) | [inline] |
a short-hand for checking that two objects have the same type.
Definition at line 62 of file object_base.h.
| virtual bool object_base::is_equal | ( | const object_base & | formalcompare_with | ) | const [inline, virtual] |
Compares two object_bases for equality.
The derived form must return false if the objects are not the same exact type. This can be checked with the above types_are_equal method. Further, the derived is_equal method should guarantee that all of the important contents are exactly equal, but that transient or unimportant variables are ignored. This is a domain specific exercise.
Definition at line 65 of file object_base.h.
Referenced by unit_base::assert_equal(), and unit_base::assert_not_equal().
1.5.6