Compare commits
3 Commits
c1cad88224
...
_old
| Author | SHA1 | Date | |
|---|---|---|---|
| 38b6137c38 | |||
| 1118ec3205 | |||
| a7abdbae57 |
Binary file not shown.
Binary file not shown.
@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "interface/StreamReader.interface.inl"
|
||||
#include "Interface/StreamReader.interface.inl"
|
||||
|
||||
namespace ia
|
||||
{
|
||||
|
||||
@ -19,11 +19,18 @@
|
||||
#include <IACore/Base.hpp>
|
||||
#include <memory>
|
||||
|
||||
#define REF_PTR_CLASS \
|
||||
template<typename _value_type, typename... Args> friend INLINE RefPtr<_value_type> MakeRefPtr(Args &&...args) \
|
||||
{ \
|
||||
return std::make_shared<_value_type>(std::forward<Args>(args)...); \
|
||||
}
|
||||
|
||||
namespace ia
|
||||
{
|
||||
template<typename _value_type>
|
||||
using RefPtr = std::shared_ptr<_value_type>;
|
||||
template<typename _value_type> using RefPtr = std::shared_ptr<_value_type>;
|
||||
|
||||
template<typename _value_type, typename... Args>
|
||||
INLINE RefPtr<_value_type> MakeRefPtr(Args... args) { return std::make_shared<_value_type>(args...); }
|
||||
}
|
||||
template<typename _value_type, typename... Args> INLINE RefPtr<_value_type> MakeRefPtr(Args &&...args)
|
||||
{
|
||||
return std::make_shared<_value_type>(std::forward<Args>(args)...);
|
||||
}
|
||||
} // namespace ia
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
|
||||
#include "platform.inl"
|
||||
|
||||
#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0))
|
||||
#include "win/environment.inl"
|
||||
#else
|
||||
#error "IACore Unsupported Platform"
|
||||
#if (defined(IA_CORE_PLATFORM_FEATUES) && (IA_CORE_PLATFORM_FEATUES > 0))
|
||||
#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0))
|
||||
#include "win/environment.inl"
|
||||
#endif
|
||||
#endif
|
||||
@ -133,3 +133,10 @@ namespace ia
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
|
||||
}
|
||||
}
|
||||
|
||||
#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0))
|
||||
#define IA_CORE_PLATFORM_FEATUES 1
|
||||
#else
|
||||
#define IA_CORE_PLATFORM_FEATUES 0
|
||||
#warning "IACore Unsupported Platform: Platform specific features will be disabled"
|
||||
#endif
|
||||
@ -18,8 +18,8 @@
|
||||
|
||||
#include "platform.inl"
|
||||
|
||||
#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0))
|
||||
#include "win/process.inl"
|
||||
#else
|
||||
#error "IACore Unsupported Platform"
|
||||
#if (defined(IA_CORE_PLATFORM_FEATUES) && (IA_CORE_PLATFORM_FEATUES > 0))
|
||||
#if (defined(IA_PLATFORM_WIN64) && (IA_PLATFORM_WIN64 > 0))
|
||||
#include "win/process.inl"
|
||||
#endif
|
||||
#endif
|
||||
@ -35,12 +35,14 @@ namespace ia
|
||||
|
||||
INLINE ~DynamicLib();
|
||||
|
||||
INLINE VOID Destroy();
|
||||
|
||||
public:
|
||||
INLINE PVOID GetSymbol(IN CONST String &name);
|
||||
|
||||
template<typename FunctionType> FunctionType GetFunction(IN CONST String &name)
|
||||
{
|
||||
return reinterpret_cast<FunctionType *>(GetSymbol(name));
|
||||
return reinterpret_cast<FunctionType>(GetSymbol(name));
|
||||
}
|
||||
|
||||
private:
|
||||
@ -57,6 +59,10 @@ namespace ia
|
||||
{
|
||||
}
|
||||
|
||||
DynamicLib::~DynamicLib()
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
DynamicLib DynamicLib::Load(IN CONST String &searchPath, IN CONST String &name)
|
||||
{
|
||||
@ -66,12 +72,6 @@ namespace ia
|
||||
return DynamicLib((PVOID) handle);
|
||||
}
|
||||
|
||||
DynamicLib::~DynamicLib()
|
||||
{
|
||||
if (m_moduleHandle)
|
||||
FreeLibrary(static_cast<HMODULE>(m_moduleHandle));
|
||||
}
|
||||
|
||||
PVOID DynamicLib::GetSymbol(IN CONST String &name)
|
||||
{
|
||||
const auto symbol = GetProcAddress(static_cast<HMODULE>(m_moduleHandle), name.c_str());
|
||||
@ -79,6 +79,12 @@ namespace ia
|
||||
THROW_UNKNOWN("DynamicLib: Failed to find the symbol \"", name, "\" with error: ", GetLastError());
|
||||
return (PVOID) symbol;
|
||||
}
|
||||
|
||||
VOID DynamicLib::Destroy()
|
||||
{
|
||||
if (m_moduleHandle)
|
||||
FreeLibrary(static_cast<HMODULE>(m_moduleHandle));
|
||||
}
|
||||
#else
|
||||
DynamicLib DynamicLib::Load(IN CONST String &searchPath, IN CONST String &name)
|
||||
{
|
||||
@ -89,20 +95,20 @@ namespace ia
|
||||
return DynamicLib((PVOID) handle);
|
||||
}
|
||||
|
||||
DynamicLib::~DynamicLib()
|
||||
PVOID DynamicLib::GetSymbol(IN CONST String &name)
|
||||
{
|
||||
dlerror();
|
||||
const auto symbol = dlsym(m_moduleHandle, name.c_str());
|
||||
const char *dlsym_error = dlerror();
|
||||
if (dlsym_error)
|
||||
THROW_UNKNOWN("DynamicLib: Failed to find the symbol \"", name, "\" with error: ", dlerror());
|
||||
return (PVOID) symbol;
|
||||
}
|
||||
|
||||
VOID DynamicLib::Destroy()
|
||||
{
|
||||
if (m_moduleHandle)
|
||||
dlclose(m_moduleHandle);
|
||||
}
|
||||
|
||||
PVOID DynamicLib::GetSymbol(IN CONST String &name)
|
||||
{
|
||||
dlerror();
|
||||
const auto symbol = dlsym(handle, name.c_str());
|
||||
const char *dlsym_error = dlerror();
|
||||
if (dlsym_error)
|
||||
THROW_UNKNOWN("DynamicLib: Failed to find the symbol \"", name, "\" with error: ", dlerror());
|
||||
return (PVOID)symbol;
|
||||
}
|
||||
#endif
|
||||
} // namespace ia
|
||||
@ -30,9 +30,9 @@ int main(int argc, char *argv[])
|
||||
SubProcess p("clang++");
|
||||
p.Launch("a.cpp", [](IN CONST String &line) { printf("[\n%s\n]\n", line.c_str()); });*/
|
||||
|
||||
printf("[%s]\n", Environment::GetVar("IAEDK_ROOT").c_str());
|
||||
Environment::SetVar("IAEDK_ROOT", "C:\\IAEDK");
|
||||
printf("[%s]\n", Environment::GetVar("IAEDK_ROOT").c_str());
|
||||
//printf("[%s]\n", Environment::GetVar("IAEDK_ROOT").c_str());
|
||||
//Environment::SetVar("IAEDK_ROOT", "C:\\IAEDK");
|
||||
//printf("[%s]\n", Environment::GetVar("IAEDK_ROOT").c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user