Scopira
20080306
|
#include <model.h>
Public Member Functions | |
virtual bool | load (scopira::tool::iobjflow_i &in) |
for title, mostly | |
virtual void | save (scopira::tool::oobjflow_i &out) const |
for title, mostly | |
virtual void | set_title (const std::string &newtitle) |
virtual bool | is_project (void) const |
const std::string & | get_title (void) const |
void | add_view (view_i *ins) const |
void | remove_view (view_i *ins) const |
void | notify_views (view_i *src) |
void | add_rename_reactor (tool::rename_reactor_i *r) const |
void | remove_rename_reactor (tool::rename_reactor_i *r) const |
virtual void | set_project (project_i *newowner) |
project_i * | get_project (void) const |
void | set_tagged_model (const std::string &name, model_i *what) |
template<class W > | |
bool | get_tagged_model (const std::string &name, W &out) |
Public Member Functions inherited from scopira::tool::object | |
virtual | ~object () |
int | add_ref (void) const |
bool | sub_ref (void) const |
void | auto_ref (void) const |
int | current_ref (void) const |
virtual scopira::tool::oflow_i & | print (scopira::tool::oflow_i &o) const |
bool | is_alive_object (void) const |
bool | is_dead_object (void) const |
Protected Member Functions | |
model_i (void) | |
Default initing ctor. | |
model_i (const std::string &title) | |
title initing ctor | |
model_i (const model_i &src) | |
copy ctor | |
virtual | ~model_i () |
dtor (mainly, to flush the cache | |
Protected Member Functions inherited from scopira::tool::object | |
object (void) | |
object (bool neverusecounter) | |
A model_i. Multiple views can monitor and watch an instance of this.
If your descendant is serializable, YOU must handle the saveing/loading of dm_title, if need be (or just call model_i::save/load())
void scopira::core::model_i::add_rename_reactor | ( | tool::rename_reactor_i * | r | ) | const |
Adds a new rename reactor that will listen to rename events.
void scopira::core::model_i::add_view | ( | view_i * | ins | ) | const |
Adds an view to this model_i's watch list. The view's bind_model will be called. This ptr will not be count_ptr'ed here.
|
inline |
Gets the current owner – may be 0 if this record currently does not have an owner.
|
inline |
Gets the tagged model attached to this type.
name | the model name |
out | where to place the model, this should be a count_ptr or model_ptr of your type |
References scopira::tool::count_ptr< T >::get(), and scopira::tool::count_ptr< T >::is_null().
|
inline |
Gets the current title
|
inlinevirtual |
Is this a model project?
Reimplemented in scopira::core::project_i.
void scopira::core::model_i::notify_views | ( | view_i * | src | ) |
Calls viewodel() on all the current views that are watching this model_i, with the given src. The src view will NOT have his viewodel method called, however. src may be null (in which case all the views are called)
void scopira::core::model_i::remove_rename_reactor | ( | tool::rename_reactor_i * | r | ) | const |
Removes a rename reactor from the listing list
void scopira::core::model_i::remove_view | ( | view_i * | ins | ) | const |
Removes an view from this model_i's watch list. The view's bind_model will be called.
|
virtual |
Sets the owning project. project do this themselves in their add_record calls. May be 0 to clear the previous owner. Descendants should call this version, which (for now), simply sets dm_owner.
void scopira::core::model_i::set_tagged_model | ( | const std::string & | name, |
model_i * | what | ||
) |
Sets a tagged (named) model attached to this model.
|
virtual |
Sets the title. Descendants may override this to do addtional actions on a title change request, but they should make sure to call this one evetually.