Skip to content

Commit

Permalink
droped namespace around dynamic bitset
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Nov 21, 2023
1 parent eee4aba commit 206b51b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 33 deletions.
4 changes: 2 additions & 2 deletions include/dlplan/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct hash_impl<std::vector<int>> {
class ConceptDenotation {
private:
int m_num_objects;
dlplan::utils::DynamicBitset<unsigned> m_data;
DynamicBitset<unsigned> m_data;

public:
explicit ConceptDenotation(int num_objects);
Expand Down Expand Up @@ -195,7 +195,7 @@ class ConceptDenotation {
class RoleDenotation {
private:
int m_num_objects;
dlplan::utils::DynamicBitset<unsigned> m_data;
DynamicBitset<unsigned> m_data;

public:
explicit RoleDenotation(int num_objects);
Expand Down
31 changes: 2 additions & 29 deletions include/dlplan/utils/dynamic_bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,10 @@
#include <vector>


namespace dlplan::utils {
template<typename Block>
class DynamicBitset;
}


namespace boost::serialization {
class access;

template <typename Archive, typename Block>
void serialize(Archive& ar, dlplan::utils::DynamicBitset<Block>& t, const unsigned int version);
}


/*
Poor man's version of boost::dynamic_bitset, mostly copied from there.
*/
namespace dlplan::utils {
namespace dlplan {

template<typename Block = unsigned int>
class DynamicBitset {
Expand Down Expand Up @@ -74,11 +60,7 @@ class DynamicBitset {
}

/// @brief Constructor for serialization.
DynamicBitset() : blocks(std::vector<Block>()), num_bits(0) { }

friend class boost::serialization::access;
template<typename Archive, typename Block_>
friend void boost::serialization::serialize(Archive& ar, DynamicBitset<Block_>& t, const unsigned int version);
//DynamicBitset() : blocks(std::vector<Block>()), num_bits(0) { }

public:
explicit DynamicBitset(std::size_t num_bits)
Expand Down Expand Up @@ -212,15 +194,6 @@ template<typename Block>
const Block DynamicBitset<Block>::ones = ~DynamicBitset<Block>::zeros;
}

namespace boost::serialization {

template<typename Archive, typename Block>
void serialize(Archive& ar, dlplan::utils::DynamicBitset<Block>& t, const unsigned int /* version */) {
ar & t.blocks;
ar & t.num_bits;
}

}

/*
This source file was derived from the boost::dynamic_bitset library
Expand Down
2 changes: 1 addition & 1 deletion src/core/concept_denotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace dlplan::core {
ConceptDenotation::ConceptDenotation(int num_objects)
: m_num_objects(num_objects), m_data(utils::DynamicBitset<unsigned>(num_objects)) { }
: m_num_objects(num_objects), m_data(DynamicBitset<unsigned>(num_objects)) { }

ConceptDenotation::ConceptDenotation(const ConceptDenotation& other) = default;

Expand Down
2 changes: 1 addition & 1 deletion src/core/role_denotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace dlplan::core {

RoleDenotation::RoleDenotation(int num_objects)
: m_num_objects(num_objects), m_data(utils::DynamicBitset<unsigned>(num_objects * num_objects)) { }
: m_num_objects(num_objects), m_data(DynamicBitset<unsigned>(num_objects * num_objects)) { }

RoleDenotation::RoleDenotation(const RoleDenotation& other) = default;

Expand Down

0 comments on commit 206b51b

Please sign in to comment.