Scopira  20080306
scopira::core::model_i Class Reference

#include <model.h>

Inheritance diagram for scopira::core::model_i:
scopira::tool::object scopira::core::project_i scopira::core::project_base

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_iget_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_iprint (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)

Detailed Description

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())

Aleksander Demko

Member Function Documentation

◆ add_rename_reactor()

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.

Aleksander Demko

◆ add_view()

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.

Aleksander Demko

◆ get_project()

project_i* scopira::core::model_i::get_project ( void  ) const

Gets the current owner – may be 0 if this record currently does not have an owner.

Aleksander Demko

◆ get_tagged_model()

template<class W >
bool scopira::core::model_i::get_tagged_model ( const std::string &  name,
W &  out 

Gets the tagged model attached to this type.

namethe model name
outwhere to place the model, this should be a count_ptr or model_ptr of your type
true on success (and fillsin out).
Aleksander Demko

References scopira::tool::count_ptr< T >::get(), and scopira::tool::count_ptr< T >::is_null().

◆ get_title()

const std::string& scopira::core::model_i::get_title ( void  ) const

Gets the current title

Aleksander Demko

◆ is_project()

virtual bool scopira::core::model_i::is_project ( void  ) const

Is this a model project?

Aleksander Demko

Reimplemented in scopira::core::project_i.

◆ notify_views()

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)

Aleksander Demko

◆ remove_rename_reactor()

void scopira::core::model_i::remove_rename_reactor ( tool::rename_reactor_i r) const

Removes a rename reactor from the listing list

Aleksander Demko

◆ remove_view()

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.

Aleksander Demko

◆ set_project()

virtual void scopira::core::model_i::set_project ( project_i newowner)

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.

Aleksander Demko

◆ set_tagged_model()

void scopira::core::model_i::set_tagged_model ( const std::string &  name,
model_i what 

Sets a tagged (named) model attached to this model.

Aleksander Demko

◆ set_title()

virtual void scopira::core::model_i::set_title ( const std::string &  newtitle)

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.

Aleksander Demko

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