yrs90
2005-04-21 00:38:32 UTC
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]
-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
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]
-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728