EXECUTE_PROCESS(COMMAND getconf LFS_LDFLAGS OUTPUT_VARIABLE LFS_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(COMMAND getconf LFS_LIBS OUTPUT_VARIABLE LFS_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
-SET(COMPILE_BASE_FLAGS "-g -fPIC -Werror -Wall -Wl,--as-needed -Wl,--no-whole-archive ${LFS_CFLAGS}")
+SET(COMPILE_BASE_FLAGS "-g -fPIC -Werror -Wall -Wl,--as-needed -Wl,--no-whole-archive -fvisibility=hidden -fvisibility-inlines-hidden ${LFS_CFLAGS}")
SET(CMAKE_C_FLAGS_PROFILING "${COMPILE_BASE_FLAGS} -O0 -pg")
SET(CMAKE_CXX_FLAGS_PROFILING "${COMPILE_BASE_FLAGS} -O0 -pg -std=${CXX_STD} -fno-rtti")
#ifndef __AUDIT_TRAIL_H__
#define __AUDIT_TRAIL_H__
+#include <klay/klay.h>
+
#include <thread>
#include <string>
namespace audit {
-class AuditTrail {
+class KLAY_EXPORT AuditTrail {
public:
AuditTrail();
~AuditTrail();
namespace audit {
-class ConsoleLogSink : public LogSink {
+class KLAY_EXPORT ConsoleLogSink : public LogSink {
public:
void sink(const std::string& message) override;
};
namespace audit {
-class DlogLogSink : public LogSink {
+class KLAY_EXPORT DlogLogSink : public LogSink {
public:
explicit DlogLogSink(const std::string& tag);
void sink(const std::string& message) override;
namespace audit {
-class LoggerCore {
+class KLAY_EXPORT LoggerCore {
public:
LoggerCore();
virtual ~LoggerCore() = default;
namespace audit {
-enum class LogLevel : int {
+enum class KLAY_EXPORT LogLevel : int {
Silent,
Error,
Warning,
Trace
};
-struct LogRecord {
+struct KLAY_EXPORT LogRecord {
LogLevel severity;
std::string file;
unsigned int line;
std::string message;
};
-class Logger {
+class KLAY_EXPORT Logger {
public:
static void log(LogSink* logSink, const LogRecord record);
};
-std::string LogLevelToString(const LogLevel level);
-LogLevel StringToLogLevel(const std::string& level);
+KLAY_EXPORT std::string LogLevelToString(const LogLevel level);
+KLAY_EXPORT LogLevel StringToLogLevel(const std::string& level);
#ifndef __FILENAME__
#define __FILENAME__ \
#ifndef __AUDIT_LOGSINK_H__
#define __AUDIT_LOGSINK_H__
+#include <klay/klay.h>
+
#include <string>
namespace audit {
-class LogSink {
+class KLAY_EXPORT LogSink {
public:
LogSink() {}
virtual ~LogSink() {}
namespace audit {
-class NullLogSink : public LogSink {
+class KLAY_EXPORT NullLogSink : public LogSink {
public:
void sink(const std::string& message) override;
};
#include <string>
+#include <klay/klay.h>
+
#ifndef INVALID_GID
#define INVALID_GID UINT_MAX
#endif
namespace runtime {
-class Group final {
+class KLAY_EXPORT Group final {
public:
Group(const std::string& name);
Group(const gid_t group);
#include <string>
+#include <klay/klay.h>
+
#ifndef INVALID_UID
#define INVALID_UID UINT_MAX
#endif
namespace runtime {
-class User final {
+class KLAY_EXPORT User final {
public:
User(const std::string& name);
User(const uid_t user);
#include <string>
#include <vector>
+#include <klay/klay.h>
+
namespace runtime {
-class Cgroup final {
+class KLAY_EXPORT Cgroup final {
public:
Cgroup() = delete;
#include <string>
+#include <klay/klay.h>
#include <klay/db/statement.h>
namespace database {
-class Column {
+class KLAY_EXPORT Column {
public:
Column(const Statement& stmt, int idx);
virtual ~Column() noexcept;
#include <string>
+#include <klay/klay.h>
+
namespace database {
-class Connection {
+class KLAY_EXPORT Connection {
public:
enum Mode {
Create = SQLITE_OPEN_CREATE,
#include <map>
#include <string>
+#include <klay/klay.h>
+
namespace database {
class Column;
class Connection;
-class Statement {
+class KLAY_EXPORT Statement {
public:
Statement(const Connection& db, const std::string& query);
virtual ~Statement();
#include <functional>
#include <map>
+#include <klay/klay.h>
#include <klay/dbus/variant.h>
namespace dbus {
-class Connection {
+class KLAY_EXPORT Connection {
public:
typedef unsigned int NameId;
typedef unsigned int ObjectId;
#include <gio/gio.h>
+#include <klay/klay.h>
+
namespace dbus {
-class Error {
+class KLAY_EXPORT Error {
public:
Error();
~Error();
#include <vector>
#include <utility>
+#include <klay/klay.h>
+
namespace dbus {
using BusNode = GDBusNodeInfo*;
using XmlProperties = std::vector<std::pair<std::string, std::string>>;
-class Introspection {
+class KLAY_EXPORT Introspection {
public:
explicit Introspection(const std::string &xmlData);
virtual ~Introspection(void);
#ifndef __RUNTIME_DBUS_SIGNAL_H__
#define __RUNTIME_DBUS_SIGNAL_H__
+
#include <string>
#include <utility>
+#include <klay/klay.h>
#include <klay/dbus/connection.h>
namespace dbus {
using SignalCallback = dbus::Connection::SignalCallback;
-class Sender {
+class KLAY_EXPORT Sender {
public:
explicit Sender(const std::string &objectPath, const std::string &interfaceName);
virtual ~Sender(void) = default;
std::string interfaceName;
};
-class Receiver {
+class KLAY_EXPORT Receiver {
public:
explicit Receiver(const std::string &objectPath, const std::string &interfaceName);
virtual ~Receiver(void) = default;
#include <string>
+#include <klay/klay.h>
+
namespace dbus {
-class Variant {
+class KLAY_EXPORT Variant {
public:
Variant();
Variant(GVariant* var);
GVariant* variant;
};
-class VariantIterator {
+class KLAY_EXPORT VariantIterator {
public:
VariantIterator(GVariantIter* it);
VariantIterator(VariantIterator&& it);
#include <string>
+#include <klay/klay.h>
+
namespace runtime {
-class Error {
+class KLAY_EXPORT Error {
public:
static std::string message();
static std::string message(int errorCode);
static int lastErrorCode();
};
-std::string GetSystemErrorMessage();
-std::string GetSystemErrorMessage(int errorCode);
+KLAY_EXPORT std::string GetSystemErrorMessage();
+KLAY_EXPORT std::string GetSystemErrorMessage(int errorCode);
} // namespace runtime
#endif //__RUNTIME_ERROR_H__
#include <sys/eventfd.h>
+#include <klay/klay.h>
+
namespace runtime {
-class EventFD {
+class KLAY_EXPORT EventFD {
public:
EventFD(unsigned int initval = 0, int flags = EFD_SEMAPHORE | EFD_CLOEXEC);
~EventFD();
#include <stdexcept>
#include <string>
+#include <klay/klay.h>
+
namespace runtime {
-class Exception: public std::runtime_error {
+class KLAY_EXPORT Exception: public std::runtime_error {
public:
Exception(const std::string& error) :
std::runtime_error(error)
virtual const char *className() const;
};
-#define EXCEPTION_DEFINE(CLS) \
- class CLS : public Exception { \
- public: \
- CLS(const std::string& error); \
- ~CLS() {} \
- const char *className() const; \
- const char *name() const; \
+#define EXCEPTION_DEFINE(CLS) \
+ class KLAY_EXPORT CLS : public Exception { \
+ public: \
+ CLS(const std::string& error); \
+ ~CLS() {} \
+ const char *className() const; \
+ const char *name() const; \
};
#ifndef __RUNTIME_FILE_DESCRIPTOR_H__
#define __RUNTIME_FILE_DESCRIPTOR_H__
+#include <klay/klay.h>
+
namespace runtime {
-struct FileDescriptor {
+struct KLAY_EXPORT FileDescriptor {
FileDescriptor(int fd = -1, bool autoclose = false) :
fileDescriptor(fd), autoClose(autoclose)
{
#include <string>
#include <vector>
+#include <klay/klay.h>
+
namespace runtime {
-class FileUser final {
+class KLAY_EXPORT FileUser final {
public:
FileUser() = delete;
#include <string>
+#include <klay/klay.h>
+
namespace runtime {
-class File {
+class KLAY_EXPORT File {
public:
File() :
descriptor(-1)
std::string path;
};
-class DirectoryIterator {
+class KLAY_EXPORT DirectoryIterator {
public:
DirectoryIterator() :
directoryHandle(nullptr)
std::string basename;
};
-class Mount final {
+class KLAY_EXPORT Mount final {
public:
Mount() = delete;
*/
#ifndef __GMAINLOOP_WRAPPER_H__
#define __GMAINLOOP_WRAPPER_H__
+
#include <thread>
#include <memory>
#include <glib.h>
-class ScopedGMainLoop {
+#include <klay/klay.h>
+
+class KLAY_EXPORT ScopedGMainLoop {
public:
ScopedGMainLoop() :
mainloop(g_main_loop_new(NULL, FALSE), g_main_loop_unref)
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+#ifndef __KLAY_H__
+#define __KLAY_H__
+
+#ifndef KLAY_EXPORT
+#define KLAY_EXPORT __attribute__((visibility("default")))
+#endif // KLAY_EXPORT
+
+#endif //__KLAY_H__
#include <mutex>
#include <condition_variable>
+#include <klay/klay.h>
+
namespace runtime {
-class Latch {
+class KLAY_EXPORT Latch {
public:
Latch() :
count(0)
#include <mutex>
#include <atomic>
+#include <klay/klay.h>
+
#include "eventfd.h"
namespace runtime {
-class Mainloop {
+class KLAY_EXPORT Mainloop {
public:
typedef unsigned int Event;
typedef std::function<void(int fd, Event event)> Callback;
#include <sched.h>
+#include <klay/klay.h>
+
namespace runtime {
-class Namespace final {
+class KLAY_EXPORT Namespace final {
public:
Namespace() = delete;
#include <linux/audit.h>
+#include <klay/klay.h>
+
namespace netlink {
-class AuditRule final {
+class KLAY_EXPORT AuditRule final {
public:
AuditRule();
AuditRule(std::vector<char>& buf);
#include <linux/audit.h>
+#include <klay/klay.h>
#include <klay/mainloop.h>
#include <klay/netlink/netlink.h>
#include <klay/netlink/audit-rule.h>
namespace netlink {
-class Audit final {
+class KLAY_EXPORT Audit final {
public:
typedef std::pair<int, std::vector<char>> Message;
typedef std::function<void(Message&)> MessageHandler;
#include <linux/netlink.h>
+#include <klay/klay.h>
+
#ifndef NETLINK_AUDIT
#define NETLINK_AUDIT 9
#endif
namespace netlink {
-class Netlink final {
+class KLAY_EXPORT Netlink final {
public:
Netlink(int);
Netlink(Netlink&&);
#include <string>
#include <vector>
+#include <klay/klay.h>
+
namespace runtime {
-class Process {
+class KLAY_EXPORT Process {
public:
typedef pid_t Pid;
#include <type_traits>
+#include <klay/klay.h>
#include <klay/preprocessor.h>
#define VISIT_ELEMENT(elem) v.visit(#elem, elem)
static void accept(V) {}
template<typename T>
-struct ReflectionTraitChecker {
+struct KLAY_EXPORT ReflectionTraitChecker {
struct Visitor {};
template <typename C> static std::true_type
};
template<typename T>
-struct IsReflectable : public std::integral_constant<bool, ReflectionTraitChecker<T>::value> {};
+struct KLAY_EXPORT IsReflectable : public std::integral_constant<bool, ReflectionTraitChecker<T>::value> {};
#endif //!__RUNTIME_REFLECTION_H__
#include <memory>
#include <iostream>
+#include <klay/klay.h>
#include <klay/mainloop.h>
#include <klay/rmi/message.h>
#include <klay/rmi/connection.h>
namespace rmi {
template <typename ExceptionModel>
-class RemoteAccessClient {
+class KLAY_EXPORT RemoteAccessClient {
public:
RemoteAccessClient(const std::string& address);
virtual ~RemoteAccessClient();
return response;
}
-class DefaultExceptionModel {
+class KLAY_EXPORT DefaultExceptionModel {
public:
void raise(const std::string& target, const std::string& except);
};
#include <mutex>
#include <string>
+#include <klay/klay.h>
#include <klay/rmi/socket.h>
#include <klay/rmi/message.h>
namespace rmi {
-class Connection {
+class KLAY_EXPORT Connection {
public:
Connection(Socket&& sock);
Connection(const Connection&) = delete;
#include <cstddef>
+#include <klay/klay.h>
+
namespace rmi {
-class MessageComposer {
+class KLAY_EXPORT MessageComposer {
public:
MessageComposer(size_t caps = 4096);
MessageComposer(const MessageComposer& rhs);
#include <memory>
#include <atomic>
+#include <klay/klay.h>
#include <klay/serialize.h>
#include <klay/file-descriptor.h>
#include <klay/rmi/message-composer.h>
namespace rmi {
-class Message {
+class KLAY_EXPORT Message {
public:
enum Type {
Invalid,
#include <utility>
#include <unordered_map>
+#include <klay/klay.h>
#include <klay/rmi/socket.h>
#include <klay/rmi/message.h>
#include <klay/audit/logger.h>
typedef std::pair<int, int> SubscriptionId;
-class Notification {
+class KLAY_EXPORT Notification {
public:
Notification();
Notification(const std::string& name);
#include <functional>
#include <unordered_map>
+#include <klay/klay.h>
#include <klay/mainloop.h>
#include <klay/thread-pool.h>
#include <klay/preprocessor.h>
typedef std::function<bool(const Credentials& cred, const std::string& privilege)> PrivilegeChecker;
typedef std::function<void(const Credentials& cred, const std::string& method, int condition)> AuditTrail;
-class Service {
+class KLAY_EXPORT Service {
public:
Service(const std::string& address);
virtual ~Service();
#ifndef __RMI_SOCKET_H__
#define __RMI_SOCKET_H__
+#include <klay/klay.h>
#include <klay/exception.h>
namespace rmi {
-class SocketException: public runtime::Exception {
+class KLAY_EXPORT SocketException: public runtime::Exception {
public:
SocketException(const std::string& msg) : runtime::Exception(msg) {}
};
-struct Credentials {
+struct KLAY_EXPORT Credentials {
pid_t pid;
uid_t uid;
gid_t gid;
std::string security;
};
-class Socket {
+class KLAY_EXPORT Socket {
public:
explicit Socket(int socketFd = -1, bool autoclose = true);
Socket(Socket&& socket) noexcept;
#include <string>
#include <utility>
+#include <klay/klay.h>
#include <klay/reflection.h>
namespace runtime {
template<typename T>
-struct SerializableArgument {
+struct KLAY_EXPORT SerializableArgument {
SerializableArgument(const T& arg) :
value(arg)
{
};
template<typename T>
-struct DeserializableArgument {
+struct KLAY_EXPORT DeserializableArgument {
DeserializableArgument(T& arg) :
value(arg)
{
};
template<class StorageType>
-class Serializer {
+class KLAY_EXPORT Serializer {
public:
Serializer(StorageType& source) :
storage(source)
};
template<class StorageType>
-class Deserializer {
+class KLAY_EXPORT Deserializer {
public:
Deserializer(StorageType& source) :
storage(source)
* limitations under the License
*/
-#ifndef __DPM_TESTBENCH_H__
-#define __DPM_TESTBENCH_H__
+#ifndef __KLAY_TESTBENCH_H__
+#define __KLAY_TESTBENCH_H__
#include <cstring>
#include <memory>
#include <sstream>
+#include <klay/klay.h>
+
namespace testbench {
-struct Source {
+struct KLAY_EXPORT Source {
Source(const std::string& file, long line, const std::string& msg);
std::string fileName;
std::string message;
};
-class TestResult {
+class KLAY_EXPORT TestResult {
public:
TestResult();
virtual ~TestResult();
int __failureCount;
};
-class TestSuite {
+class KLAY_EXPORT TestSuite {
public:
TestSuite(const std::string& name);
virtual ~TestSuite();
TestCaseRegistry __registry;
};
-class Testbench {
+class KLAY_EXPORT Testbench {
public:
static void addTestSuite(TestSuite *testSuite);
static void runAllTestSuites();
return; \
}
} // namespace testbench
-#endif //!__DPM_TESTBENCH_H__
+#endif //!__KLAY_TESTBENCH_H__
#include <vector>
#include <deque>
+#include <klay/klay.h>
+
namespace runtime {
-class ThreadPool {
+class KLAY_EXPORT ThreadPool {
public:
ThreadPool(size_t threads);
~ThreadPool();
#include <string>
+#include <klay/klay.h>
#include <klay/xml/node.h>
namespace xml {
-class Document {
+class KLAY_EXPORT Document {
public:
Document(const std::string& root, const std::string& version = XML_DEFAULT_VERSION);
Document(xmlDoc* doc);
#include <libxml/globals.h>
+#include <klay/klay.h>
+
namespace xml {
-class KeepBlanks {
+class KLAY_EXPORT KeepBlanks {
public:
KeepBlanks(bool value);
~KeepBlanks();
#include <libxml/tree.h>
#include <libxml/parser.h>
+#include <klay/klay.h>
+
namespace xml {
-class Node {
+class KLAY_EXPORT Node {
public:
typedef std::vector<Node> NodeList;
#include <string>
+#include <klay/klay.h>
#include <klay/xml/document.h>
namespace xml {
-class Parser {
+class KLAY_EXPORT Parser {
public:
static Document* parseFile(const std::string& filename, bool validate = false);
static Document* parseString(const std::string& xml, bool validate = false);