Skip to content

Commit

Permalink
Merge pull request #19 from lsst/tickets/DM-15151
Browse files Browse the repository at this point in the history
DM-15151: Set symbol visibility to hidden in pybind11 wrappers
  • Loading branch information
r-owen committed Sep 12, 2018
2 parents f41ba6b + 5f7d60a commit 404ea43
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 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
9 changes: 5 additions & 4 deletions include/lsst/pex/policy/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#ifndef LSST_PEX_POLICY_EXCEPTIONS_H
#define LSST_PEX_POLICY_EXCEPTIONS_H

#include "lsst/base.h"
#include "lsst/pex/exceptions.h"

#define POL_EARGS_TYPED char const* ex_file, int ex_line, char const* ex_func
Expand All @@ -52,7 +53,7 @@ namespace policy {
* either starts with a period, ends with a period, or contains two or more
* consecutive periods.
*/
class BadNameError : public lsst::pex::exceptions::RuntimeError {
class LSST_EXPORT BadNameError : public lsst::pex::exceptions::RuntimeError {
public:
BadNameError(POL_EARGS_TYPED)
: lsst::pex::exceptions::RuntimeError(
Expand All @@ -69,7 +70,7 @@ class BadNameError : public lsst::pex::exceptions::RuntimeError {
/**
* There is a problem with a dictionary.
*/
class DictionaryError : public lsst::pex::exceptions::DomainError {
class LSST_EXPORT DictionaryError : public lsst::pex::exceptions::DomainError {
public:
DictionaryError(POL_EARGS_TYPED)
: lsst::pex::exceptions::DomainError(
Expand All @@ -87,7 +88,7 @@ class DictionaryError : public lsst::pex::exceptions::DomainError {
* an exception indicating that a policy parameter of a given name can
* not be found in a Policy object.
*/
class NameNotFound : public lsst::pex::exceptions::NotFoundError {
class LSST_EXPORT NameNotFound : public lsst::pex::exceptions::NotFoundError {
public:
NameNotFound(POL_EARGS_TYPED)
: lsst::pex::exceptions::NotFoundError(
Expand All @@ -105,7 +106,7 @@ class NameNotFound : public lsst::pex::exceptions::NotFoundError {
* an exception indicating that a policy parameter with a given name has a
* type different from the one that was requested.
*/
class TypeError : public lsst::pex::exceptions::DomainError {
class LSST_EXPORT TypeError : public lsst::pex::exceptions::DomainError {
public:
TypeError(POL_EARGS_TYPED)
: lsst::pex::exceptions::DomainError(
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 404ea43

Please sign in to comment.