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

List of all members.

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)

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

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

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
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
project_i* scopira::core::model_i::get_project ( void  ) const [inline]

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

Aleksander Demko
template<class W >
bool scopira::core::model_i::get_tagged_model ( const std::string &  name,
W &  out 
) [inline]

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

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

Gets the current title

Aleksander Demko
virtual bool scopira::core::model_i::is_project ( void  ) const [inline, virtual]

Is this a model project?

Aleksander Demko

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)

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

Removes a rename reactor from the listing list

Aleksander Demko
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
virtual void scopira::core::model_i::set_project ( project_i newowner) [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.

Aleksander Demko
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
virtual void scopira::core::model_i::set_title ( const std::string &  newtitle) [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.

Aleksander Demko

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