Files
NazaraEngine/include/Nazara/Core/DynLib.hpp
Lynix 15afde86c8 Rewritted ResourceLoader and moved it to core
Added creation constructor to NzImage
Added member function functor
Added option to build Nazara as one library (instead of many)
Fixed some 2011 copyrights
Made use of "using def = T" C++11 feature instead of some illigible
typedefs
Removed unused premake file
2012-08-18 01:46:01 +02:00

47 lines
1.0 KiB
C++

// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_DYNLIB_HPP
#define NAZARA_DYNLIB_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/NonCopyable.hpp>
#include <Nazara/Core/String.hpp>
#if NAZARA_CORE_THREADSAFE && NAZARA_THREADSAFETY_DYNLIB
#include <Nazara/Core/ThreadSafety.hpp>
#else
#include <Nazara/Core/ThreadSafetyOff.hpp>
#endif
class NzDynLibImpl;
typedef int (*NzDynLibFunc)(); // Type "générique" de pointeur sur fonction
class NzDynLib : NzNonCopyable
{
friend NzDynLibImpl;
public:
NzDynLib(const NzString& libraryPath);
~NzDynLib();
NzString GetLastError() const;
NzDynLibFunc GetSymbol(const NzString& symbol) const;
bool Load();
void Unload();
private:
void SetLastError(const NzString& error);
NazaraMutexAttrib(m_mutex, mutable)
NzString m_lastError;
NzString m_path;
NzDynLibImpl* m_impl;
};
#endif // NAZARA_DYNLIB_HPP