SharedLibrary.h
Go to the documentation of this file.
/*
* Robot Testing Framework
*
* Copyright (C) 2015-2019 Istituto Italiano di Tecnologia (IIT)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ROBOTTESTINGFRAMEWORK_SHAREDLIBRARY_H
#define ROBOTTESTINGFRAMEWORK_SHAREDLIBRARY_H
#include <string>
namespace shlibpp {
class SharedLibrary;
}
class shlibpp::SharedLibrary
{
public:
SharedLibrary();
SharedLibrary(const char* filename);
virtual ~SharedLibrary();
bool open(const char* filename);
bool close();
std::string error();
void* getSymbol(const char* symbolName);
bool isValid() const;
private:
void* implementation;
std::string err_message;
SharedLibrary(const SharedLibrary&); // Not implemented
SharedLibrary& operator=(const SharedLibrary&); // Not implemented
};
#endif // ROBOTTESTINGFRAMEWORK_SHAREDLIBRARY_H
shlibpp::SharedLibrary
Low-level wrapper for loading shared libraries (DLLs) and accessing symbols within it.
Definition: SharedLibrary.h:36
shlibpp::SharedLibrary::error
std::string error()
Returns a human-readable string describing the most recent error that occurred from a call to one of ...
shlibpp::SharedLibrary::implementation
void * implementation
Definition: SharedLibrary.h:93
shlibpp::SharedLibrary::SharedLibrary
SharedLibrary(const char *filename)
Load the named shared library / DLL.
shlibpp::SharedLibrary::isValid
bool isValid() const
Check if the shared library is valid.
shlibpp::SharedLibrary::getSymbol
void * getSymbol(const char *symbolName)
Look up a symbol in the shared library.
shlibpp::SharedLibrary::~SharedLibrary
virtual ~SharedLibrary()
Destructor.
shlibpp::SharedLibrary::SharedLibrary
SharedLibrary()
Initialize, without opening a shared library yet.
shlibpp::SharedLibrary::err_message
std::string err_message
Definition: SharedLibrary.h:94
shlibpp::SharedLibrary::operator=
SharedLibrary & operator=(const SharedLibrary &)
shlibpp::SharedLibrary::open
bool open(const char *filename)
Load the named shared library / DLL.
shlibpp::SharedLibrary::SharedLibrary
SharedLibrary(const SharedLibrary &)
shlibpp::SharedLibrary::close
bool close()
Shared library no longer needed, unload if not in use elsewhere.
shlibpp
Definition: SharedLibrary.h:27