Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove inPlace #10

Merged
merged 1 commit into from
Aug 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
67 changes: 28 additions & 39 deletions include/lsst/daf/base/PropertyList.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,84 +115,73 @@ class PropertyList : public PropertySet {

// Modifiers
template <typename T> void set(
std::string const& name, T const& value, bool inPlace=true);
std::string const& name, T const& value);
void set(
std::string const& name, PropertySet::Ptr const& value,
bool inPlace=true);
std::string const& name, PropertySet::Ptr const& value);
template <typename T> void set(
std::string const& name, std::vector<T> const& value,
bool inPlace=true);
std::string const& name, std::vector<T> const& value);
void set(
std::string const& name, char const* value, bool inPlace=true);
std::string const& name, char const* value);
template <typename T> void add(
std::string const& name, T const& value, bool inPlace=true);
std::string const& name, T const& value);
template <typename T> void add(
std::string const& name, std::vector<T> const& value,
bool inPlace=true);
std::string const& name, std::vector<T> const& value);
void add(
std::string const& name, char const* value, bool inPlace=true);
std::string const& name, char const* value);

template <typename T> void set(
std::string const& name, T const& value,
std::string const& comment, bool inPlace=true);
std::string const& comment);
template <typename T> void set(
std::string const& name, std::vector<T> const& value,
std::string const& comment, bool inPlace=true);
std::string const& comment);
void set(
std::string const& name, char const* value,
std::string const& comment, bool inPlace=true);
std::string const& comment);
template <typename T> void add(
std::string const& name, T const& value,
std::string const& comment, bool inPlace=true);
std::string const& comment);
template <typename T> void add(
std::string const& name, std::vector<T> const& value,
std::string const& comment, bool inPlace=true);
std::string const& comment);
void add(
std::string const& name, char const* value,
std::string const& comment, bool inPlace=true);
std::string const& comment);

template <typename T> void set(
std::string const& name, T const& value,
char const* comment, bool inPlace=true) {
set(name, value, std::string(comment), inPlace);
char const* comment) {
set(name, value, std::string(comment));
}
template <typename T> void set(
std::string const& name, std::vector<T> const& value,
char const* comment, bool inPlace=true) {
set(name, value, std::string(comment), inPlace);
char const* comment) {
set(name, value, std::string(comment));
}
void set(
std::string const& name, char const* value,
char const* comment, bool inPlace=true) {
set(name, value, std::string(comment), inPlace);
char const* comment) {
set(name, value, std::string(comment));
}
template <typename T> void add(
std::string const& name, T const& value,
char const* comment, bool inPlace=true) {
add(name, value, std::string(comment), inPlace);
char const* comment) {
add(name, value, std::string(comment));
}
template <typename T> void add(
std::string const& name, std::vector<T> const& value,
char const* comment, bool inPlace=true) {
add(name, value, std::string(comment), inPlace);
char const* comment) {
add(name, value, std::string(comment));
}
void add(
std::string const& name, char const* value,
char const* comment, bool inPlace=true) {
add(name, value, std::string(comment), inPlace);
}

virtual void copy(std::string const& dest, PropertySet::ConstPtr source,
std::string const& name) {
copy(dest, source, name, true);
}
virtual void combine(PropertySet::ConstPtr source) {
combine(source, true);
char const* comment) {
add(name, value, std::string(comment));
}

virtual void copy(std::string const& dest, PropertySet::ConstPtr source,
std::string const& name, bool inPlace);
virtual void combine(PropertySet::ConstPtr source, bool inPlace);
std::string const& name);
virtual void combine(PropertySet::ConstPtr source);

virtual void remove(std::string const& name);

Expand All @@ -205,7 +194,7 @@ class PropertyList : public PropertySet {
std::shared_ptr< std::vector<boost::any> > vp);
virtual void _moveToEnd(std::string const& name);
virtual void _commentOrderFix(
std::string const& name, std::string const& comment, bool inPlace);
std::string const& name, std::string const& comment);

CommentMap _comments;
std::list<std::string> _order;
Expand Down
11 changes: 4 additions & 7 deletions python/lsst/daf/base/baseLib.i
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,8 @@ del _PS_toDict
%extend lsst::daf::base::PropertyList {
static std::type_info const TYPE_ ## typeName = typeid(type);
void setPropertySet(
std::string const& name, PropertySet::Ptr const& value,
bool inPlace=true) {
$self->set(name, value, inPlace);
std::string const& name, PropertySet::Ptr const& value) {
$self->set(name, value);
}
}
%enddef
Expand Down Expand Up @@ -290,17 +289,15 @@ _PL_typeMenu = {bool: "Bool",

def _PL_getValue(self, name, asArray=False):
return _propertyContainerGet(self, name, asArray)
def _PL_setValue(self, name, value, comment=None, inPlace=True):
def _PL_setValue(self, name, value, comment=None):
args = []
if comment is not None:
args.append(comment)
args.append(inPlace)
return _propertyContainerSet(self, name, value, _PL_typeMenu, *args)
def _PL_addValue(self, name, value, comment=None, inPlace=True):
def _PL_addValue(self, name, value, comment=None):
args = []
if comment is not None:
args.append(comment)
args.append(inPlace)
return _propertyContainerAdd(self, name, value, _PL_typeMenu, *args)

PropertyList.get = _PL_getValue
Expand Down