Skip to content

Commit

Permalink
Apply corrections from the "include what you use" tool
Browse files Browse the repository at this point in the history
Generally cleanups of the includes. Making sure each file
can properly stand on its own and forward declares when possible.
  • Loading branch information
lefticus committed May 11, 2014
1 parent f29af46 commit c0bf6ee
Show file tree
Hide file tree
Showing 25 changed files with 305 additions and 57 deletions.
8 changes: 8 additions & 0 deletions include/chaiscript/chaiscript_stdlib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
#ifndef CHAISCRIPT_STDLIB_HPP_
#define CHAISCRIPT_STDLIB_HPP_

#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "chaiscript_defines.hpp"
#include "dispatchkit/dispatchkit.hpp"
#include "dispatchkit/bootstrap.hpp"
#include "dispatchkit/bootstrap_stl.hpp"
#include "dispatchkit/boxed_value.hpp"

/// @file
///
Expand Down
7 changes: 7 additions & 0 deletions include/chaiscript/dispatchkit/bad_boxed_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
#ifndef CHAISCRIPT_BAD_BOXED_CAST_HPP_
#define CHAISCRIPT_BAD_BOXED_CAST_HPP_

#include <string>
#include <typeinfo>

#include "type_info.hpp"

namespace chaiscript {
class Type_Info;
} // namespace chaiscript

namespace chaiscript
{
namespace exception
Expand Down
26 changes: 22 additions & 4 deletions include/chaiscript/dispatchkit/bootstrap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,31 @@
#ifndef CHAISCRIPT_BOOTSTRAP_HPP_
#define CHAISCRIPT_BOOTSTRAP_HPP_

#include <cstdint>
#include <exception>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <vector>

#include "bad_boxed_cast.hpp"
#include "boxed_cast.hpp"
#include "boxed_number.hpp"
#include "boxed_value.hpp"
#include "dispatchkit.hpp"
#include "dynamic_cast_conversion.hpp"
#include "dynamic_object.hpp"
#include "register_function.hpp"
#include "operators.hpp"
#include "boxed_number.hpp"
#include <sstream>
#include <type_traits>
#include "proxy_constructors.hpp"
#include "proxy_functions.hpp"
#include "proxy_functions_detail.hpp"
#include "register_function.hpp"
#include "type_info.hpp"

namespace chaiscript
{
Expand Down
14 changes: 13 additions & 1 deletion include/chaiscript/dispatchkit/bootstrap_stl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@
#ifndef CHAISCRIPT_BOOTSTRAP_STL_HPP_
#define CHAISCRIPT_BOOTSTRAP_STL_HPP_

#include "dispatchkit.hpp"
#include <functional>
#include <iterator>
#include <memory>
#include <stdexcept>
#include <string>
#include <typeinfo>
#include <vector>

#include "bootstrap.hpp"
#include "boxed_value.hpp"
#include "dispatchkit.hpp"
#include "operators.hpp"
#include "proxy_constructors.hpp"
#include "register_function.hpp"
#include "type_info.hpp"

namespace chaiscript
{
Expand Down
18 changes: 14 additions & 4 deletions include/chaiscript/dispatchkit/boxed_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@
#ifndef CHAISCRIPT_BOXED_CAST_HPP_
#define CHAISCRIPT_BOXED_CAST_HPP_

#include "../chaiscript_defines.hpp"
#include <type_traits>

#include "type_info.hpp"
#include "boxed_value.hpp"
#include "../chaiscript_defines.hpp"
#include "../chaiscript_threading.hpp"
#include "bad_boxed_cast.hpp"
#include "boxed_cast_helper.hpp"
#include "boxed_value.hpp"
#include "dynamic_cast_conversion.hpp"
#include "type_info.hpp"

#include "../chaiscript_threading.hpp"
namespace chaiscript {
class Dynamic_Cast_Conversions;
namespace detail {
namespace exception {
class bad_any_cast;
} // namespace exception
} // namespace detail
} // namespace chaiscript

namespace chaiscript
{
Expand Down
6 changes: 5 additions & 1 deletion include/chaiscript/dispatchkit/boxed_cast_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
#ifndef CHAISCRIPT_BOXED_CAST_HELPER_HPP_
#define CHAISCRIPT_BOXED_CAST_HELPER_HPP_

#include "type_info.hpp"
#include <functional>
#include <memory>
#include <type_traits>

#include "boxed_value.hpp"
#include "type_info.hpp"


namespace chaiscript
Expand Down
16 changes: 13 additions & 3 deletions include/chaiscript/dispatchkit/boxed_number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@
#ifndef CHAISCRIPT_BOXED_NUMERIC_HPP_
#define CHAISCRIPT_BOXED_NUMERIC_HPP_

#include "boxed_value.hpp"
#include "../language/chaiscript_algebraic.hpp"
#include <sstream>
#include <cstdint>
#include <sstream>
#include <string>

#include "../language/chaiscript_algebraic.hpp"
#include "any.hpp"
#include "boxed_cast.hpp"
#include "boxed_cast_helper.hpp"
#include "boxed_value.hpp"
#include "type_info.hpp"

namespace chaiscript {
class Dynamic_Cast_Conversions;
} // namespace chaiscript

namespace chaiscript
{
Expand Down
8 changes: 5 additions & 3 deletions include/chaiscript/dispatchkit/boxed_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
#ifndef CHAISCRIPT_BOXED_VALUE_HPP_
#define CHAISCRIPT_BOXED_VALUE_HPP_

#include "type_info.hpp"
#include <functional>
#include <map>
#include <memory>
#include <type_traits>

#include "../chaiscript_threading.hpp"

#include <map>
#include "any.hpp"
#include "type_info.hpp"

namespace chaiscript
{
Expand Down
40 changes: 30 additions & 10 deletions include/chaiscript/dispatchkit/dispatchkit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,43 @@
#ifndef CHAISCRIPT_DISPATCHKIT_HPP_
#define CHAISCRIPT_DISPATCHKIT_HPP_

#include <typeinfo>
#include <string>
#include <algorithm>
#include <cassert>
#include <deque>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <stdexcept>
#include <string>
#include <typeinfo>
#include <utility>
#include <vector>
#include <iostream>
#include <deque>
#include <list>
#include <algorithm>

#include "../chaiscript_defines.hpp"
#include "../chaiscript_threading.hpp"
#include "boxed_cast.hpp"
#include "boxed_cast_helper.hpp"
#include "boxed_value.hpp"
#include "type_info.hpp"
#include "proxy_functions.hpp"
#include "proxy_constructors.hpp"
#include "dynamic_cast_conversion.hpp"
#include "dynamic_object.hpp"
#include "../chaiscript_threading.hpp"
#include "proxy_constructors.hpp"
#include "proxy_functions.hpp"
#include "type_info.hpp"

namespace chaiscript {
class Boxed_Number;
} // namespace chaiscript

namespace chaiscript {
namespace dispatch {
class Dynamic_Proxy_Function;
class Proxy_Function_Base;
struct Placeholder_Object;
} // namespace dispatch
} // namespace chaiscript


/// \namespace chaiscript::dispatch
Expand Down
11 changes: 8 additions & 3 deletions include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@

#include <memory>
#include <set>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <typeinfo>

#include "type_info.hpp"
#include "boxed_value.hpp"
#include "boxed_cast_helper.hpp"
#include "../chaiscript_threading.hpp"
#include "bad_boxed_cast.hpp"
#include "boxed_cast_helper.hpp"
#include "boxed_value.hpp"
#include "type_info.hpp"

namespace chaiscript
{
Expand Down
21 changes: 20 additions & 1 deletion include/chaiscript/dispatchkit/dynamic_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,27 @@
#ifndef CHAISCRIPT_DYNAMIC_OBJECT_HPP_
#define CHAISCRIPT_DYNAMIC_OBJECT_HPP_

#include <cassert>
#include <map>
#include <memory>
#include <string>
#include <typeinfo>
#include <utility>

#include <vector>

#include "../chaiscript_defines.hpp"
#include "boxed_cast.hpp"
#include "boxed_cast_helper.hpp"
#include "boxed_value.hpp"
#include "proxy_functions.hpp"
#include "type_info.hpp"

namespace chaiscript {
class Dynamic_Cast_Conversions;
namespace dispatch {
class Proxy_Function_Base;
} // namespace dispatch
} // namespace chaiscript

namespace chaiscript
{
Expand Down
10 changes: 10 additions & 0 deletions include/chaiscript/dispatchkit/exception_specification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@
#ifndef CHAISCRIPT_EXCEPTION_SPECIFICATION_HPP_
#define CHAISCRIPT_EXCEPTION_SPECIFICATION_HPP_

#include <memory>

#include "../chaiscript_defines.hpp"
#include "boxed_cast.hpp"

namespace chaiscript {
class Boxed_Value;
namespace exception {
class bad_boxed_cast;
} // namespace exception
} // namespace chaiscript

namespace chaiscript
{
namespace detail
Expand Down
15 changes: 12 additions & 3 deletions include/chaiscript/dispatchkit/function_call.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@
#ifndef CHAISCRIPT_FUNCTION_CALL_HPP_
#define CHAISCRIPT_FUNCTION_CALL_HPP_

#include <functional>
#include <iostream>
#include <string>
#include <vector>
#include "proxy_functions.hpp"
#include "function_call_detail.hpp"

#include "boxed_cast.hpp"
#include "function_call_detail.hpp"
#include "proxy_functions.hpp"

#include <iostream>
namespace chaiscript {
class Boxed_Value;
class Dynamic_Cast_Conversions;
namespace detail {
template <typename T> struct Cast_Helper;
} // namespace detail
} // namespace chaiscript

namespace chaiscript
{
Expand Down
9 changes: 9 additions & 0 deletions include/chaiscript/dispatchkit/function_call_detail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@
#ifndef CHAISCRIPT_FUNCTION_CALL_DETAIL_HPP_
#define CHAISCRIPT_FUNCTION_CALL_DETAIL_HPP_

#include <algorithm>
#include <functional>
#include <memory>
#include <string>
#include <type_traits>
#include <vector>

#include "boxed_cast.hpp"
#include "boxed_number.hpp"
#include "boxed_value.hpp"
#include "dynamic_cast_conversion.hpp"
#include "proxy_functions.hpp"

namespace chaiscript
Expand Down
14 changes: 10 additions & 4 deletions include/chaiscript/dispatchkit/handle_return.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
#ifndef CHAISCRIPT_HANDLE_RETURN_HPP_
#define CHAISCRIPT_HANDLE_RETURN_HPP_

#include "boxed_value.hpp"
#include <functional>
#include <memory>
#include <stdexcept>
#include <string>
#include <vector>

#include "boxed_number.hpp"
#include "boxed_value.hpp"
#include "type_info.hpp"
#include <string>

#include <stdexcept>
#include <vector>
namespace chaiscript {
class Boxed_Number;
} // namespace chaiscript

namespace chaiscript
{
Expand Down
Loading

0 comments on commit c0bf6ee

Please sign in to comment.