[litwindow-users] User containers?
Status: Alpha
Brought to you by:
hajokirchhoff
From: yrs90 <yr...@ya...> - 2005-04-21 00:38:40
|
I'm not sure if I'm doing this right. I'd like to mediate access to the container so that I know if data has changed, possibly to filter data sent to views, and to provide some map-like capabilities to the vector (unique container, named lookup). Before I had the following class ... { vector<MyListItem> m_list; }; BEGIN_ADAPTER(...) PROP(m_list) END_ADAPTER() IMPLEMENT_ADAPTER_CONTAINER(vector<MyListItem>) I tried the following: class MyContainer : public vector<MyListItem> { bool IsDirty() const; void SetDirty(const bool); // all constructors and all modification functions ... }; MyContainer m_list; BEGIN_ADAPTER(MyContainer) PROP_I(vector<MyListItem>) PROP_RW_FUNC(IsDirty, SetDirty, "Dirty") END_ADAPTER() IMPLEMENT_ADAPTER_CONTAINER(vector<MyListItem>) class ... { MyContainer m_list; }; BEGIN_ADAPTER(...) PROP(m_list) END_ADAPTER() By the way, in order to do this I had to insert a space before the closing bracket of the PROP_I macro to avoid >>. Is this a valid way to proceed? Regards, Joel --- [This E-mail scanned for viruses by Declude Virus] |