Skip to content

Commit c0bf6ee

Browse files
committed
Apply corrections from the "include what you use" tool
Generally cleanups of the includes. Making sure each file can properly stand on its own and forward declares when possible.
1 parent f29af46 commit c0bf6ee

25 files changed

Lines changed: 305 additions & 57 deletions

include/chaiscript/chaiscript_stdlib.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@
77
#ifndef CHAISCRIPT_STDLIB_HPP_
88
#define CHAISCRIPT_STDLIB_HPP_
99

10+
#include <map>
11+
#include <memory>
12+
#include <string>
13+
#include <utility>
14+
#include <vector>
15+
1016
#include "chaiscript_defines.hpp"
17+
#include "dispatchkit/dispatchkit.hpp"
1118
#include "dispatchkit/bootstrap.hpp"
1219
#include "dispatchkit/bootstrap_stl.hpp"
20+
#include "dispatchkit/boxed_value.hpp"
1321

1422
/// @file
1523
///

include/chaiscript/dispatchkit/bad_boxed_cast.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
#ifndef CHAISCRIPT_BAD_BOXED_CAST_HPP_
88
#define CHAISCRIPT_BAD_BOXED_CAST_HPP_
99

10+
#include <string>
11+
#include <typeinfo>
12+
1013
#include "type_info.hpp"
1114

15+
namespace chaiscript {
16+
class Type_Info;
17+
} // namespace chaiscript
18+
1219
namespace chaiscript
1320
{
1421
namespace exception

include/chaiscript/dispatchkit/bootstrap.hpp

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,31 @@
77
#ifndef CHAISCRIPT_BOOTSTRAP_HPP_
88
#define CHAISCRIPT_BOOTSTRAP_HPP_
99

10+
#include <cstdint>
11+
#include <exception>
12+
#include <functional>
13+
#include <iostream>
14+
#include <map>
15+
#include <memory>
16+
#include <sstream>
17+
#include <stdexcept>
18+
#include <string>
19+
#include <type_traits>
20+
#include <vector>
21+
22+
#include "bad_boxed_cast.hpp"
23+
#include "boxed_cast.hpp"
24+
#include "boxed_number.hpp"
25+
#include "boxed_value.hpp"
1026
#include "dispatchkit.hpp"
27+
#include "dynamic_cast_conversion.hpp"
1128
#include "dynamic_object.hpp"
12-
#include "register_function.hpp"
1329
#include "operators.hpp"
14-
#include "boxed_number.hpp"
15-
#include <sstream>
16-
#include <type_traits>
30+
#include "proxy_constructors.hpp"
31+
#include "proxy_functions.hpp"
32+
#include "proxy_functions_detail.hpp"
33+
#include "register_function.hpp"
34+
#include "type_info.hpp"
1735

1836
namespace chaiscript
1937
{

include/chaiscript/dispatchkit/bootstrap_stl.hpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,21 @@
1313
#ifndef CHAISCRIPT_BOOTSTRAP_STL_HPP_
1414
#define CHAISCRIPT_BOOTSTRAP_STL_HPP_
1515

16-
#include "dispatchkit.hpp"
16+
#include <functional>
17+
#include <iterator>
18+
#include <memory>
19+
#include <stdexcept>
20+
#include <string>
21+
#include <typeinfo>
22+
#include <vector>
23+
1724
#include "bootstrap.hpp"
25+
#include "boxed_value.hpp"
26+
#include "dispatchkit.hpp"
27+
#include "operators.hpp"
28+
#include "proxy_constructors.hpp"
1829
#include "register_function.hpp"
30+
#include "type_info.hpp"
1931

2032
namespace chaiscript
2133
{

include/chaiscript/dispatchkit/boxed_cast.hpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,24 @@
77
#ifndef CHAISCRIPT_BOXED_CAST_HPP_
88
#define CHAISCRIPT_BOXED_CAST_HPP_
99

10-
#include "../chaiscript_defines.hpp"
10+
#include <type_traits>
1111

12-
#include "type_info.hpp"
13-
#include "boxed_value.hpp"
12+
#include "../chaiscript_defines.hpp"
13+
#include "../chaiscript_threading.hpp"
14+
#include "bad_boxed_cast.hpp"
1415
#include "boxed_cast_helper.hpp"
16+
#include "boxed_value.hpp"
1517
#include "dynamic_cast_conversion.hpp"
18+
#include "type_info.hpp"
1619

17-
#include "../chaiscript_threading.hpp"
20+
namespace chaiscript {
21+
class Dynamic_Cast_Conversions;
22+
namespace detail {
23+
namespace exception {
24+
class bad_any_cast;
25+
} // namespace exception
26+
} // namespace detail
27+
} // namespace chaiscript
1828

1929
namespace chaiscript
2030
{

include/chaiscript/dispatchkit/boxed_cast_helper.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
#ifndef CHAISCRIPT_BOXED_CAST_HELPER_HPP_
88
#define CHAISCRIPT_BOXED_CAST_HELPER_HPP_
99

10-
#include "type_info.hpp"
10+
#include <functional>
11+
#include <memory>
12+
#include <type_traits>
13+
1114
#include "boxed_value.hpp"
15+
#include "type_info.hpp"
1216

1317

1418
namespace chaiscript

include/chaiscript/dispatchkit/boxed_number.hpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@
77
#ifndef CHAISCRIPT_BOXED_NUMERIC_HPP_
88
#define CHAISCRIPT_BOXED_NUMERIC_HPP_
99

10-
#include "boxed_value.hpp"
11-
#include "../language/chaiscript_algebraic.hpp"
12-
#include <sstream>
1310
#include <cstdint>
11+
#include <sstream>
12+
#include <string>
13+
14+
#include "../language/chaiscript_algebraic.hpp"
15+
#include "any.hpp"
16+
#include "boxed_cast.hpp"
17+
#include "boxed_cast_helper.hpp"
18+
#include "boxed_value.hpp"
19+
#include "type_info.hpp"
20+
21+
namespace chaiscript {
22+
class Dynamic_Cast_Conversions;
23+
} // namespace chaiscript
1424

1525
namespace chaiscript
1626
{

include/chaiscript/dispatchkit/boxed_value.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
#ifndef CHAISCRIPT_BOXED_VALUE_HPP_
88
#define CHAISCRIPT_BOXED_VALUE_HPP_
99

10-
#include "type_info.hpp"
10+
#include <functional>
11+
#include <map>
12+
#include <memory>
13+
#include <type_traits>
1114

1215
#include "../chaiscript_threading.hpp"
13-
14-
#include <map>
1516
#include "any.hpp"
17+
#include "type_info.hpp"
1618

1719
namespace chaiscript
1820
{

include/chaiscript/dispatchkit/dispatchkit.hpp

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,43 @@
77
#ifndef CHAISCRIPT_DISPATCHKIT_HPP_
88
#define CHAISCRIPT_DISPATCHKIT_HPP_
99

10-
#include <typeinfo>
11-
#include <string>
10+
#include <algorithm>
11+
#include <cassert>
12+
#include <deque>
13+
#include <iostream>
14+
#include <iterator>
15+
#include <list>
1216
#include <map>
17+
#include <memory>
1318
#include <set>
1419
#include <stdexcept>
20+
#include <string>
21+
#include <typeinfo>
22+
#include <utility>
1523
#include <vector>
16-
#include <iostream>
17-
#include <deque>
18-
#include <list>
19-
#include <algorithm>
2024

25+
#include "../chaiscript_defines.hpp"
26+
#include "../chaiscript_threading.hpp"
27+
#include "boxed_cast.hpp"
28+
#include "boxed_cast_helper.hpp"
2129
#include "boxed_value.hpp"
22-
#include "type_info.hpp"
23-
#include "proxy_functions.hpp"
24-
#include "proxy_constructors.hpp"
30+
#include "dynamic_cast_conversion.hpp"
2531
#include "dynamic_object.hpp"
26-
#include "../chaiscript_threading.hpp"
32+
#include "proxy_constructors.hpp"
33+
#include "proxy_functions.hpp"
34+
#include "type_info.hpp"
35+
36+
namespace chaiscript {
37+
class Boxed_Number;
38+
} // namespace chaiscript
39+
40+
namespace chaiscript {
41+
namespace dispatch {
42+
class Dynamic_Proxy_Function;
43+
class Proxy_Function_Base;
44+
struct Placeholder_Object;
45+
} // namespace dispatch
46+
} // namespace chaiscript
2747

2848

2949
/// \namespace chaiscript::dispatch

include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@
99

1010
#include <memory>
1111
#include <set>
12+
#include <stdexcept>
13+
#include <string>
14+
#include <type_traits>
15+
#include <typeinfo>
1216

13-
#include "type_info.hpp"
14-
#include "boxed_value.hpp"
15-
#include "boxed_cast_helper.hpp"
17+
#include "../chaiscript_threading.hpp"
1618
#include "bad_boxed_cast.hpp"
19+
#include "boxed_cast_helper.hpp"
20+
#include "boxed_value.hpp"
21+
#include "type_info.hpp"
1722

1823
namespace chaiscript
1924
{

0 commit comments

Comments
 (0)