Skip to content

Commit

Permalink
Rename impl to detail.
Browse files Browse the repository at this point in the history
- Nested detail easier.
  • Loading branch information
billyquith committed Feb 17, 2019
1 parent 192360e commit a5797c4
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 30 deletions.
4 changes: 2 additions & 2 deletions include/ponder/uses/detail/lua.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ struct LuaValueWriter<std::tuple<R...>> : public LuaValueWriter<const std::tuple

namespace ponder {
namespace lua {
namespace impl {
namespace detail {

using namespace ponder_ext;

Expand Down Expand Up @@ -477,7 +477,7 @@ class FunctionCallerImpl : public FunctionCaller
}
};

} // namespace impl
} // namespace detail
} // namespace lua
} // namespace ponder

Expand Down
18 changes: 9 additions & 9 deletions include/ponder/uses/detail/runtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@

namespace ponder {
namespace runtime {
namespace impl {
namespace detail {

//-----------------------------------------------------------------------------
// Handle returning copies

template <typename R, typename U = void> struct CallReturnCopy;

template <typename R>
struct CallReturnCopy<R, typename std::enable_if<!detail::IsUserType<R>::value>::type>
struct CallReturnCopy<R, typename std::enable_if<!ponder::detail::IsUserType<R>::value>::type>
{
static inline Value value(R&& o) {return Value(o);}
};

template <typename R>
struct CallReturnCopy<R, typename std::enable_if<detail::IsUserType<R>::value>::type>
struct CallReturnCopy<R, typename std::enable_if<ponder::detail::IsUserType<R>::value>::type>
{
static inline Value value(R&& o) {return Value(UserObject::makeCopy(std::forward<R>(o)));}
};
Expand All @@ -62,8 +62,8 @@ template <typename R, typename U = void> struct CallReturnInternalRef;
template <typename R>
struct CallReturnInternalRef<R,
typename std::enable_if<
!detail::IsUserType<R>::value
&& !std::is_same<typename detail::RawType<R>::Type, UserObject>::value
!ponder::detail::IsUserType<R>::value
&& !std::is_same<typename ponder::detail::RawType<R>::Type, UserObject>::value
>::type>
{
static inline Value value(R&& o) {return Value(o);}
Expand All @@ -72,8 +72,8 @@ struct CallReturnInternalRef<R,
template <typename R>
struct CallReturnInternalRef<R,
typename std::enable_if<
detail::IsUserType<R>::value
|| std::is_same<typename detail::RawType<R>::Type, UserObject>::value
ponder::detail::IsUserType<R>::value
|| std::is_same<typename ponder::detail::RawType<R>::Type, UserObject>::value
>::type>
{
static inline Value value(R&& o) {return Value(UserObject::makeRef(std::forward<R>(o)));}
Expand Down Expand Up @@ -169,7 +169,7 @@ struct ConvertArg<(int)ValueKind::User, const TTo&>
template <typename A>
struct ConvertArgs
{
typedef typename ::ponder::detail::RawType<A>::Type Raw;
typedef typename ponder::detail::RawType<A>::Type Raw;
static constexpr ValueKind kind = ponder_ext::ValueMapper<Raw>::kind;
typedef ConvertArg<(int)kind, A> Convertor;

Expand Down Expand Up @@ -269,7 +269,7 @@ class FunctionCallerImpl final : public FunctionCaller
}
};

} // namespace impl
} // namespace detail
} // namespace runtime
} // namespace ponder

Expand Down
12 changes: 6 additions & 6 deletions include/ponder/uses/lua.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern "C" {
* \namespace ponder::lua::detail
* \brief Ponder Lua support hidden implementation details.
*
* \namespace ponder::lua::impl
* \namespace ponder::lua::detail
* \brief Ponder Lua support hidden implementation details.
*/

Expand Down Expand Up @@ -153,7 +153,7 @@ PONDER_API bool runString(lua_State *L, const char *luaCode);

namespace ponder {
namespace lua {
namespace impl {
namespace detail {

// push a Ponder value onto the Lua state stack
static int pushValue(lua_State *L, const ponder::Value& val,
Expand Down Expand Up @@ -285,7 +285,7 @@ static int l_inst_index(lua_State *L)
const Function *fp = nullptr;
if (cls->tryFunction(key, fp))
{
lua::impl::FunctionCaller *caller =
lua::detail::FunctionCaller *caller =
std::get<uses::Uses::eLuaModule>(
*reinterpret_cast<const uses::Uses::PerFunctionUserData*>(fp->getUsesData()));

Expand Down Expand Up @@ -362,7 +362,7 @@ static int l_get_class_static(lua_State *L)
const Function *func = nullptr;
if (cls->tryFunction(key, func))
{
lua::impl::FunctionCaller *caller =
lua::detail::FunctionCaller *caller =
std::get<uses::Uses::eLuaModule>(
*reinterpret_cast<const uses::Uses::PerFunctionUserData*>(func->getUsesData()));

Expand Down Expand Up @@ -399,11 +399,11 @@ static void createInstanceMetatable(lua_State *L, const Class& cls)
lua_pop(L, 2); // -1 _G, _G.METAS
}

} // namespace impl
} // namespace detail

void expose(lua_State *L, const Class& cls, const IdRef name)
{
using namespace impl;
using namespace detail;

// ensure _G.META
lua_pushglobaltable(L); // +1
Expand Down
5 changes: 2 additions & 3 deletions include/ponder/uses/runtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,9 @@ class ObjectCaller
private:

const Function &m_func;
runtime::impl::FunctionCaller *m_caller;
runtime::detail::FunctionCaller *m_caller;
};


/**
* \brief This object is used to invoke a function
*
Expand Down Expand Up @@ -261,7 +260,7 @@ class FunctionCaller
private:

const Function &m_func;
runtime::impl::FunctionCaller *m_caller;
runtime::detail::FunctionCaller *m_caller;
};

//--------------------------------------------------------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions include/ponder/uses/uses.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ namespace uses {
*
* \code
* struct Module_name {
* static module_ns::impl::PerConstructor_t* perConstructor(IdRef name, C constructor)
* static module_ns::impl::PerFunc_t* perFunction(IdRef name, F function)
* static module_ns::detail::PerConstructor_t* perConstructor(IdRef name, C constructor)
* static module_ns::detail::PerFunc_t* perFunction(IdRef name, F function)
* }
* \endcode
*/
Expand All @@ -68,9 +68,9 @@ struct RuntimeModule
{
/// Factory for per-function runtime data
template <typename F, typename FTraits, typename Policies_t>
static runtime::impl::FunctionCaller* perFunction(IdRef name, F function)
static runtime::detail::FunctionCaller* perFunction(IdRef name, F function)
{
return new runtime::impl::FunctionCallerImpl<F, FTraits, Policies_t>(name, function);
return new runtime::detail::FunctionCallerImpl<F, FTraits, Policies_t>(name, function);
}
};

Expand All @@ -84,9 +84,9 @@ struct LuaModule
{
/// Factory for per-function runtime data
template <typename F, typename FTraits, typename Policies_t>
static lua::impl::FunctionCaller* perFunction(IdRef name, F function)
static lua::detail::FunctionCaller* perFunction(IdRef name, F function)
{
return new lua::impl::FunctionCallerImpl<F, FTraits, Policies_t>(name, function);
return new lua::detail::FunctionCallerImpl<F, FTraits, Policies_t>(name, function);
}
};
#endif // PONDER_USING_LUA
Expand All @@ -99,8 +99,8 @@ struct LuaModule
struct Uses
{
enum {
eRuntimeModule, ///< Runtime module enumeration
PONDER_IF_LUA(eLuaModule) ///< Lua module enumeration
eRuntimeModule, ///< Runtime module enumeration
PONDER_IF_LUA(eLuaModule) ///< Lua module enumeration
};

/// Modules we would like to use.
Expand All @@ -109,8 +109,8 @@ struct Uses

/// Type that stores the per-function uses data
typedef std::tuple<
runtime::impl::FunctionCaller*
PONDER_IF_LUA(,lua::impl::FunctionCaller*)
runtime::detail::FunctionCaller*
PONDER_IF_LUA(,lua::detail::FunctionCaller*)
> PerFunctionUserData;

// Access note:
Expand Down

0 comments on commit a5797c4

Please sign in to comment.