Skip to content

Commit

Permalink
Add parser ifdefs directly in poplite lib
Browse files Browse the repository at this point in the history
  • Loading branch information
lwinkler committed Aug 23, 2018
1 parent 6e3b320 commit 0302da5
Show file tree
Hide file tree
Showing 37 changed files with 49 additions and 38 deletions.
2 changes: 2 additions & 0 deletions alloc/alloc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POP_ALLOC_H
#define POP_ALLOC_H

Expand All @@ -27,3 +28,4 @@ class allocator {
}

#endif
#endif
2 changes: 2 additions & 0 deletions alloc/local.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POP_ALLOC_LOCAL_H
#define POP_ALLOC_LOCAL_H

Expand Down Expand Up @@ -63,3 +64,4 @@ class local_allocator : public allocator {
}

#endif
#endif
2 changes: 2 additions & 0 deletions alloc/manual.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POP_ALLOC_MANUAL_H
#define POP_ALLOC_MANUAL_H

Expand All @@ -31,3 +32,4 @@ class manual_allocator : public allocator {
}

#endif
#endif
2 changes: 2 additions & 0 deletions alloc/ssh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POP_ALLOC_SSH_H
#define POP_ALLOC_SSH_H

Expand Down Expand Up @@ -54,3 +55,4 @@ class ssh_allocator : public allocator {
}

#endif
#endif
2 changes: 2 additions & 0 deletions class/apply_tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POPLITE_APPLY_TUPLE_H
#define POPLITE_APPLY_TUPLE_H

Expand Down Expand Up @@ -142,3 +143,4 @@ R apply_tuple( R (*f)(ArgsF...),
}
} // namespace
#endif
#endif
2 changes: 2 additions & 0 deletions class/apply_tuple_const.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POPLITE_APPLY_TUPLE_CONST_H
#define POPLITE_APPLY_TUPLE_CONST_H

Expand Down Expand Up @@ -142,3 +143,4 @@ R apply_tuple_const( R (*f)(ArgsF...),
}
} // namespace
#endif
#endif
2 changes: 2 additions & 0 deletions class/apply_tuple_constr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POPLITE_APPLY_TUPLE_CONSTR_H
#define POPLITE_APPLY_TUPLE_CONSTR_H

Expand Down Expand Up @@ -68,3 +69,4 @@ template < typename T, typename... ArgsF, typename... ArgsT > T* apply_tuple_con
}
} // namespace
#endif
#endif
2 changes: 2 additions & 0 deletions class/apply_tuple_static.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POPLITE_APPLY_TUPLE_STATIC_H
#define POPLITE_APPLY_TUPLE_STATIC_H

Expand Down Expand Up @@ -142,3 +143,4 @@ R apply_tuple_static( R (*f)(ArgsF...),
}
} // namespace
#endif
#endif
2 changes: 2 additions & 0 deletions class/broker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef _POP_PARSER_
#ifndef POPLITE_BROKER_H
#define POPLITE_BROKER_H

Expand Down Expand Up @@ -160,3 +161,4 @@ template<class ParClass> class broker : private boost::noncopyable {
} // namespaces

#endif
#endif
3 changes: 2 additions & 1 deletion class/interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POPLITE_INTERFACE_H
#define POPLITE_INTERFACE_H

Expand Down Expand Up @@ -205,5 +206,5 @@ class interface {
}
};
}

#endif
#endif
3 changes: 2 additions & 1 deletion class/system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POPLITE_SYSTEM_H
#define POPLITE_SYSTEM_H

Expand Down Expand Up @@ -204,5 +205,5 @@ class system {
};
}


#endif
#endif
2 changes: 2 additions & 0 deletions com/accesspoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef _POP_PARSER_
#ifndef POP_ACCESSPOINT_HPP
#define POP_ACCESSPOINT_HPP

Expand Down Expand Up @@ -58,3 +59,4 @@ class accesspoint {
} // namespace

#endif
#endif
2 changes: 2 additions & 0 deletions com/broker_combox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POP_BROKER_COMBOX_H
#define POP_BROKER_COMBOX_H

Expand Down Expand Up @@ -231,3 +232,4 @@ template<class ParClass>class broker_combox {
} // namespace

#endif
#endif
2 changes: 2 additions & 0 deletions com/connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POP_CONNECTION_HPP
#define POP_CONNECTION_HPP

Expand Down Expand Up @@ -262,3 +263,4 @@ using connection_ptr = boost::shared_ptr<connection>;
} // namespace

#endif
#endif
2 changes: 2 additions & 0 deletions com/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef _POP_PARSER_
#ifndef POP_EXCEPTION_HPP
#define POP_EXCEPTION_HPP

Expand Down Expand Up @@ -39,3 +40,4 @@ class exception : public std::exception {
} // namespace

#endif
#endif
2 changes: 2 additions & 0 deletions com/interface_combox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POP_INTERFACE_COMBOX_H
#define POP_INTERFACE_COMBOX_H

Expand Down Expand Up @@ -110,3 +111,4 @@ class interface_combox {
} // namespace

#endif
#endif
2 changes: 2 additions & 0 deletions com/serialize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POPLITE_SERIALIZE_H
#define POPLITE_SERIALIZE_H

Expand Down Expand Up @@ -63,3 +64,4 @@ void serialize_out(Archive & ar, std::tuple<Args...> & t1) {
}

#endif
#endif
2 changes: 2 additions & 0 deletions com/serialize_tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
or implied, of Christopher Allen Ogden.
*/

#ifndef _POP_PARSER_
#ifndef _SERIALIZE_TUPLE_
#define _SERIALIZE_TUPLE_
#include <tuple>
Expand Down Expand Up @@ -52,3 +53,4 @@ void serialize(Archive & ar, std::tuple<Args...> & t, const unsigned int version
}
}
#endif
#endif
2 changes: 2 additions & 0 deletions com/serialize_unique_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef _POP_PARSER_
#ifndef POPLITE_SERIALIZE_UNIQUE_PTR_H
#define POPLITE_SERIALIZEUNIQUE_PTR__H

Expand Down Expand Up @@ -49,3 +50,4 @@ inline void serialize(
} // namespace boost

#endif
#endif
2 changes: 0 additions & 2 deletions examples/chat/chat_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
#include <map>
#include <string>

#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"
#include "com/accesspoint.hpp"
Expand Down
2 changes: 0 additions & 2 deletions examples/get_and_set/test_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
#include <string>
#include <boost/core/noncopyable.hpp>

#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"

Expand Down
2 changes: 0 additions & 2 deletions examples/inheritance/child.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
#include <iostream>
#include <string>

#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"

Expand Down
2 changes: 0 additions & 2 deletions examples/ping_pong/mutex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
#include <iostream>
#include <boost/signals2/mutex.hpp>

#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"

Expand Down
2 changes: 0 additions & 2 deletions examples/ping_pong/ping_pong.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
#include <iostream>
#include <memory>

#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "alloc/ssh.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"
#include "com/accesspoint.hpp"
Expand Down
2 changes: 0 additions & 2 deletions examples/templates/map_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@

#include <map>

#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"

Expand Down
2 changes: 0 additions & 2 deletions examples/templates/printer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@

#include <iostream>

#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"

Expand Down
2 changes: 0 additions & 2 deletions examples/templates/storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@

#include <vector>

#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"

Expand Down
3 changes: 0 additions & 3 deletions examples/word_list_game/server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
#include <map>
#include <set>


#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"
#include "com/accesspoint.hpp"
Expand Down
12 changes: 11 additions & 1 deletion parser/defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ __attribute__((annotate("pop_template_method:"#types)))\
static int template_types_of_##name;
*/

// Forward declarations
namespace pop {
class allocator;
class interface;
class system;
class accesspoint;
class connection;
class exception;
class interface_combox;
}

#else
// Do not use in normal time
#define POP_CLASS class
Expand All @@ -30,6 +41,5 @@ static int template_types_of_##name;
#define POP_ALLOCATION(x)
#define POP_TEMPLATE_TYPES(...)
// #define POP_TEMPLATE_METHOD(x,y,z)

#endif
#endif
2 changes: 0 additions & 2 deletions popc_tests/asynccreation/POPObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
* @date 2012.07.11
*/

#ifndef _POP_PARSER_ // this accelerates parsing
#include "class/system.hpp"
#include "alloc/local.hpp"
#include "class/interface.hpp"
#endif

#include "parser/defs.hpp"

Expand Down
Loading

0 comments on commit 0302da5

Please sign in to comment.