Skip to content

Commit

Permalink
Fix macOS issues with hidden symbol visilibity
Browse files Browse the repository at this point in the history
by adding Policy::typeOfPolicy and typeOfFile and using those instead
of typeid of daf::base objects.
  • Loading branch information
r-owen committed Aug 29, 2018
1 parent 59cd9e4 commit 5f7d60a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/lsst/pex/policy/Policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ inline bool Policy::isString(const std::string& name) const {

inline bool Policy::isPolicy(const std::string& name) const {
try {
return (_data->typeOf(name) == typeid(lsst::daf::base::PropertySet::Ptr));
return _data->isPropertySetPtr(name);
}
catch (...) {
return false;
Expand Down
8 changes: 4 additions & 4 deletions src/Policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ Policy::ValueType Policy::getValueType(const string& name) const {
const std::type_info& tp = _data->typeOf(name);

// handle the special case of FilePtr first
if (tp == typeid(Persistable::Ptr)) {
if (tp == daf::base::PropertySet::typeOfT<std::shared_ptr<daf::base::Persistable>>()) {
try {
getFile(name);
return FILE;
Expand All @@ -451,7 +451,7 @@ Policy::ValueType Policy::getValueType(const string& name) const {
else if (tp == typeid(string)) {
return STRING;
}
else if (tp == typeid(PropertySet::Ptr)) {
else if (tp == daf::base::PropertySet::typeOfT<std::shared_ptr<daf::base::PropertySet>>()) {
return POLICY;
}
else {
Expand Down Expand Up @@ -822,7 +822,7 @@ string Policy::str(const string& name, const string& indent) const {
if (vi+1 != s.end()) out << ", ";
}
}
else if (tp == typeid(PropertySet::Ptr)) {
else if (tp == daf::base::PropertySet::typeOfT<std::shared_ptr<daf::base::PropertySet>>()) {
vector<PropertySet::Ptr> p =
_data->getArray<PropertySet::Ptr>(name);
vector<PropertySet::Ptr>::iterator vi;
Expand All @@ -834,7 +834,7 @@ string Policy::str(const string& name, const string& indent) const {
out.flush();
}
}
else if (tp == typeid(Persistable::Ptr)) {
else if (tp == daf::base::PropertySet::typeOfT<std::shared_ptr<daf::base::Persistable>>()) {
FilePtrArray f = getFileArray(name);
FilePtrArray::iterator vi;
for(vi= f.begin(); vi != f.end(); ++vi) {
Expand Down
4 changes: 2 additions & 2 deletions src/PolicyWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ void PolicyWriter::write(const Policy& policy, bool doDecl) {
else if (tp == typeid(std::string)) {
writeStrings(*ni, policy.getStringArray(*ni));
}
else if (tp == typeid(PropertySet::Ptr)) {
else if (tp == daf::base::PropertySet::typeOfT<std::shared_ptr<daf::base::PropertySet>>()) {
writePolicies(*ni, policy.getPolicyArray(*ni));
}
else if (tp == typeid(Persistable::Ptr)) {
else if (tp == daf::base::PropertySet::typeOfT<std::shared_ptr<daf::base::Persistable>>()) {
writeFiles(*ni, policy.getFileArray(*ni));
}
else {
Expand Down

0 comments on commit 5f7d60a

Please sign in to comment.