#include <klay/mainloop.h>
-namespace audit {
+namespace klay {
class KLAY_EXPORT AuditTrail {
public:
std::thread dispatcher;
};
-} // namespace audit
+} // namespace klay
+
+namespace audit = klay;
+
#endif //__AUDIT_TRAIL_H__
#include "logsink.h"
-namespace audit {
+namespace klay {
class KLAY_EXPORT ConsoleLogSink : public LogSink {
public:
void sink(const std::string& message) override;
};
-} // namespace audit
+} // namespace klay
+
+namespace audit = klay;
+
#endif //__AUDIT_CONSOLE_LOGSINK_H__
#include "logsink.h"
-namespace audit {
+namespace klay {
class KLAY_EXPORT DlogLogSink : public LogSink {
public:
std::string tag;
};
-} // namespace audit
+} // namespace klay
+
+namespace audit = klay;
+
#endif //__AUDIT_DLOG_LOGSINK_H__
#include <memory>
#include <mutex>
-namespace audit {
+namespace klay {
class KLAY_EXPORT LoggerCore {
public:
ConsoleLogSink defaultSink;
};
-} // namespace audit
+} // namespace klay
+
+namespace audit = klay;
+
#endif //__AUDIT_LOGGER_CORE_H__
#include "logsink.h"
-namespace audit {
+namespace klay {
enum class KLAY_EXPORT LogLevel : int {
Silent,
#define INFO(args...) GET_MACRO(args, INFO2, INFO1)(args)
#define TRACE(args...) GET_MACRO(args, TRACE2, TRACE1)(args)
-} // namespace audit
+} // namespace klay
+
+namespace audit = klay;
+
#endif //__AUDIT_LOGGER_H__
#include <string>
-namespace audit {
+namespace klay {
class KLAY_EXPORT LogSink {
public:
virtual void sink(const std::string& message) = 0;
};
-} // namespace audit
+} // namespace klay
+
+namespace audit = klay;
+
#endif //__AUDIT_LOGSINK_H__
#include "logsink.h"
-namespace audit {
+namespace klay {
class KLAY_EXPORT NullLogSink : public LogSink {
public:
void sink(const std::string& message) override;
};
-} // namespace audit
+} // namespace klay
+
+namespace audit = klay;
+
#endif //__AUDIT_NULL_LOGSINK_H__
#define INVALID_GID UINT_MAX
#endif
-namespace runtime {
+namespace klay {
class KLAY_EXPORT Group final {
public:
gid_t gid;
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
#endif //__RUNTIME_GROUP_H__
#define INVALID_UID UINT_MAX
#endif
-namespace runtime {
+namespace klay {
class KLAY_EXPORT User final {
public:
gid_t gid;
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
#endif //__RUNTIME_USER_H__
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT Cgroup final {
public:
static const std::string getPath(const std::string& subsystem, const pid_t pid);
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
#endif //!__RUNTIME_CGROUP_H__
#include <ostream>
-namespace console {
+namespace klay {
enum Code {
BLACK = 31,
Code code;
};
-} // namespace console
+} // namespace klay
+
+namespace console = klay;
\ No newline at end of file
#include <klay/klay.h>
#include <klay/db/statement.h>
+namespace klay {
namespace database {
class KLAY_EXPORT Column {
};
} // namespace database
+} // namespace klay
+
+namespace database = klay::database;
#endif //__DATABASE_COLUMN_H__
#include <klay/klay.h>
+namespace klay {
namespace database {
class KLAY_EXPORT Connection {
};
} // namespace database
+} // namespace klay
+
+namespace database = klay::database;
+
#endif //__DATABASE_CONNECTION_H__
#include <klay/klay.h>
+namespace klay {
namespace database {
class Column;
};
} // namespace database
+} // namespace klay
+
+namespace database = klay::database;
#endif //__DATABASE_STATEMENT_H__
#include <klay/klay.h>
#include <klay/dbus/variant.h>
+namespace klay {
namespace dbus {
class KLAY_EXPORT Connection {
};
} // namespace dbus
+} // namespace klay
+
+namespace dbus = klay::dbus;
#endif //! __RUNTIME_DBUS_CONNECTION_H__
#include <klay/klay.h>
+namespace klay {
namespace dbus {
class KLAY_EXPORT Error {
};
} // namespace dbus
+} // namespace klay
+
+namespace dbus = klay::dbus;
#endif //!__RUNTIME_DBUS_ERROR_H__
#include <klay/klay.h>
+namespace klay {
namespace dbus {
using BusNode = GDBusNodeInfo*;
};
} // namespace dbus
+} // namespace klay
+
+namespace dbus = klay::dbus;
#endif //! __RUNTIME_DBUS_INTROSPECTION_H__
#include <klay/klay.h>
#include <klay/dbus/connection.h>
+namespace klay {
namespace dbus {
namespace signal {
} // namespace signal
} // namespace dbus
+} // namespace klay
+
+namespace dbus = klay::dbus;
#endif //! __RUNTIME_DBUS_SIGNAL_H__
#include <klay/klay.h>
+namespace klay {
namespace dbus {
class KLAY_EXPORT Variant {
GVariantIter* iterator;
};
-
} // namespace dbus
+} // namespace klay
+
+namespace dbus = klay::dbus;
#endif //!__RUNTIME_DBUS_VARIANT_H__
#ifndef __RUNTIME_ERROR_H__
#define __RUNTIME_ERROR_H__
+#include <errno.h>
+
#include <string>
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT Error {
public:
KLAY_EXPORT std::string GetSystemErrorMessage();
KLAY_EXPORT std::string GetSystemErrorMessage(int errorCode);
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
+
#endif //__RUNTIME_ERROR_H__
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT EventFD {
public:
int fd;
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
#endif //__RUNTIME_EVENTFD_H__
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT Exception: public std::runtime_error {
public:
EXCEPTION_DEFINE(NoPermissionException)
EXCEPTION_DEFINE(OutOfMemoryException)
EXCEPTION_DEFINE(IOException)
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
+
#endif //__RUNTIME_EXCEPTION_H__
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
struct KLAY_EXPORT FileDescriptor {
FileDescriptor(int fd = -1, bool autoclose = false) :
bool autoClose;
};
-}
+} // namespace klay
+
+namespace runtime = klay;
#endif //__RUNTIME_FILE_DESCRIPTOR_H__
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT FileUser final {
public:
static std::vector<pid_t> getList(const std::string &path, bool isMount = false);
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
#endif /* __FILE_USER_H__ */
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT File {
public:
int Open(const std::string& path, int flags, mode_t mode);
void Close(int fd);
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
+
#endif //__RUNTIME_FILESYSTEM_H__
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT Latch {
public:
unsigned int count;
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
+
#endif // __RUNTIME_LATCH_H__
#include "eventfd.h"
-namespace runtime {
+namespace klay {
class KLAY_EXPORT Mainloop {
public:
void prepare();
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
#endif //__RUNTIME_MAINLOOP_H__
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT Namespace final {
public:
static void attach(const pid_t pid);
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
#endif //!__RUNTIME_NAMESPACE_H__
#define NETLINK_AUDIT 9
#endif
+namespace klay {
namespace netlink {
class KLAY_EXPORT Netlink final {
unsigned int sequence;
};
-} // namespace runtime
+} // namespace netlink
+} // namespace klay
+
+namespace netlink = klay::netlink;
#endif //!__RUNTIME_NETLINK_NETLINK_H__
#include <syslog.h>
#include <security/pam_appl.h>
-namespace runtime {
+namespace klay {
class PAM final {
public:
pam_handle_t* pamh;
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
+
#endif // __RUNTIME_PAM_H__
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT Process {
public:
std::vector<std::string> args;
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
+
#endif //__RUNTIME_PROCESS_H__
#include <klay/rmi/message.h>
+namespace klay {
namespace rmi {
template<typename Type, typename... Args>
};
} // namespace rmi
+} // namespace klay
+
+namespace rmi = klay::rmi;
+
#endif //!__RMI_CALLBACK_HOLDER_H__
#include <klay/rmi/connection.h>
#include <klay/rmi/callback-holder.h>
+namespace klay {
namespace rmi {
template <typename ExceptionModel>
using Client = RemoteAccessClient<DefaultExceptionModel>;
} // namespace rmi
+} // namespace klay
+
+namespace rmi = klay::rmi;
+
#endif //__RMI_CLIENT_H__
#include <klay/rmi/socket.h>
#include <klay/rmi/message.h>
+namespace klay {
namespace rmi {
class KLAY_EXPORT Connection {
};
} // namespace rmi
+} // namespace klay
+
+namespace rmi = klay::rmi;
+
#endif //__RMI_CONNECTION_H__
#include <klay/klay.h>
+namespace klay {
namespace rmi {
class KLAY_EXPORT MessageComposer {
};
} // namespae rmi
+} // namespae klay
+
+namespace rmi = klay::rmi;
+
#endif //__RMI_MESSAGE_COMPOSER_H__
#include <klay/file-descriptor.h>
#include <klay/rmi/message-composer.h>
+namespace klay {
namespace rmi {
class KLAY_EXPORT Message {
template<> void Message::disclose(runtime::FileDescriptor& fd);
} // namespae rmi
+} // namespae klay
+
+namespace rmi = klay::rmi;
+
#endif //__RMI_MESSAGE_H__
#include <klay/rmi/connection.h>
#include <klay/rmi/callback-holder.h>
+namespace klay {
namespace rmi {
template <typename ExceptionModel = DefaultExceptionModel>
}
} // namespace rmi
+} // namespace klay
+
+namespace rmi = klay::rmi;
+
#endif //__RMI_REMOTEMETHOD_H__
#include <klay/rmi/message.h>
#include <klay/audit/logger.h>
+namespace klay {
namespace rmi {
typedef std::pair<int, int> SubscriptionId;
}
} // namespae rmi
+} // namespae klay
+
+namespace rmi = klay::rmi;
+
#endif //__RMI_NOTIFICATION_H__
setMethodHandler<TYPEOF(M)> \
(P, STRINGIFY(TYPEOF(STRIP(M))), std::bind(&TYPEOF(STRIP(M)), T))
+namespace klay {
namespace rmi {
typedef std::function<bool(const Connection& connection)> ConnectionCallback;
}
} // namespace rmi
+} // namespace klay
+
+namespace rmi = klay::rmi;
#endif //__RMI_SERVICE_H__
#include <klay/klay.h>
#include <klay/exception.h>
+namespace klay {
namespace rmi {
class KLAY_EXPORT SocketException: public runtime::Exception {
};
} // namespace rmi
+} // namespace klay
+
+namespace rmi = klay::rmi;
+
#endif //__RMI_SOCKET_H__
#include <klay/klay.h>
#include <klay/reflection.h>
-namespace runtime {
+namespace klay {
template<typename T>
struct KLAY_EXPORT SerializableArgument {
StorageType& storage;
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
#endif //__RUNTIME_SERIALIZER_H__
auto ms = duration_cast<milliseconds>(end - start); \
auto time = ms.count();
+namespace klay {
namespace testbench {
struct KLAY_EXPORT Source {
return; \
}
} // namespace testbench
+} // namespace klay
+
+namespace testbench = klay::testbench;
+
#endif //!__KLAY_TESTBENCH_H__
#include <klay/klay.h>
-namespace runtime {
+namespace klay {
class KLAY_EXPORT ThreadPool {
public:
bool stop;
};
-} // namespace runtime
+} // namespace klay
+
+namespace runtime = klay;
#endif //__RUNTIME_THREAD_POOL_H__
#include <klay/klay.h>
#include <klay/xml/node.h>
+namespace klay {
namespace xml {
class KLAY_EXPORT Document {
};
} // namespace xml
+} // namespace klay
+
+namespace xml = klay::xml;
+
#endif //__XML_DOCUMENT_H__
#include <klay/klay.h>
+namespace klay {
namespace xml {
class KLAY_EXPORT KeepBlanks {
};
} // namespace xml
+} // namespace klay
+
+namespace xml = klay::xml;
+
#endif //__XML_KEEPBLANKS_H__
#include <klay/klay.h>
+namespace klay {
namespace xml {
class KLAY_EXPORT Node {
};
} // namespace xml
+} // namespace klay
+
+namespace xml = klay::xml;
+
#endif //__XML_NODE_H__
#include <klay/klay.h>
#include <klay/xml/document.h>
+namespace klay {
namespace xml {
class KLAY_EXPORT Parser {
};
} // namespace xml
+} // namespace klay
+
+namespace xml = klay::xml;
+
#endif //__XML_DOMPARSER_H__
*/
#include <klay/audit/audit-trail.h>
-namespace audit {
+namespace klay {
AuditTrail::AuditTrail()
{
mainloop.removeEventSource(fd);
}
-} // namespace audit
+} // namespace klay
#include <klay/audit/console-sink.h>
-namespace audit {
+namespace klay {
void ConsoleLogSink::sink(const std::string& message)
{
std::cout << message << std::flush;
}
-} // namespace audit
+} // namespace klay
#include <klay/audit/dlog-sink.h>
#include <klay/audit/logger.h>
-namespace audit {
+namespace klay {
DlogLogSink::DlogLogSink(const std::string& tag) : tag(tag) {}
}
}
-} // namespace audit
+} // namespace klay
#include <klay/audit/logger-core.h>
-namespace audit {
+namespace klay {
std::unique_ptr<LoggerCore> LoggerCore::instance = nullptr;
std::once_flag LoggerCore::flag;
logSink->sink(message);
}
-} // namespace audit
+} // namespace klay
#include <klay/audit/logger-core.h>
#include <klay/audit/console-sink.h>
-namespace audit {
+namespace klay {
std::string LogLevelToString(const LogLevel level)
{
LoggerCore::GetInstance().dispatch(logSink, buffer.str());
}
-} // namespace audit
+} // namespace klay
*/
#include <klay/audit/null-sink.h>
-namespace audit {
+namespace klay {
void NullLogSink::sink(const std::string& message)
{
};
-} // namespace audit
+} // namespace klay
#include <klay/exception.h>
#include <klay/auth/group.h>
-namespace runtime {
+namespace klay {
Group::Group(const Group& group) :
name(group.name), gid(group.gid)
{
}
-} // namespace Shadow
+} // namespace klay
#include <klay/exception.h>
#include <klay/auth/user.h>
-namespace runtime {
+namespace klay {
User::User(const User& user) :
name(user.name), uid(user.uid), gid(user.gid)
{
}
-} // namespace runtime
+} // namespace klay
#define NAME_PATTERN "^[A-Za-z_][A-Za-z0-9_-]*"
#define PATH_PATTERN "(/*[A-Za-z_][A-Za-z0-9_-]*)*"
-namespace runtime {
+namespace klay {
bool Cgroup::existSubsystem(const std::string& name)
{
return ret;
}
-} // namespace runtime
+} // namespace klay
*/
#include <klay/db/column.h>
+namespace klay {
namespace database {
Column::Column(const Statement& stmt, int idx) :
}
} // namespace database
+} // namespace klay
#include <klay/exception.h>
#include <klay/db/connection.h>
+namespace klay {
namespace database {
Connection::Connection(const std::string& name, const int flags, bool integrityCheck) :
}
} // namespace database
+} // namespace klay
#include <klay/db/statement.h>
#include <klay/db/connection.h>
+namespace klay {
namespace database {
Statement::Statement(const Connection& db, const std::string& query) :
}
} // namespace database
+} // namespace klay
#include <klay/dbus/connection.h>
#include <klay/audit/logger.h>
+namespace klay {
namespace dbus {
namespace {
}
} // namespace dbus
+} // namespace klay
*/
#include <klay/dbus/error.h>
+namespace klay {
namespace dbus {
Error::Error() :
}
} // namespace dbus
+} // namespace klay
#include <memory>
#include <functional>
+namespace klay {
namespace dbus {
namespace {
}
} // namespace dbus
+} // namespace klay
#include <klay/dbus/introspection.h>
#include <klay/exception.h>
+namespace klay {
namespace dbus {
namespace signal {
} // namespace signal
} // namespace dbus
+} // namespace klay
*/
#include <klay/dbus/variant.h>
+namespace klay {
namespace dbus {
Variant::Variant(GVariant* var) :
}
} // namespace dbus
+} // namespace klay
#include <klay/error.h>
-namespace runtime {
+namespace klay {
int Error::lastErrorCode()
{
return Error::message();
}
-} // namespace runtime
+} // namespace klay
#include <klay/eventfd.h>
#include <klay/exception.h>
-namespace runtime {
+namespace klay {
EventFD::EventFD(unsigned int initval, int flags)
{
}
}
-} // namespace runtime
+} // namespace klay
#include <klay/exception.h>
#include <klay/preprocessor.h>
-namespace runtime {
+namespace klay {
const char *Exception::name() const
{
EXCEPTION_IMPLEMENT(NoPermissionException, "No permission")
EXCEPTION_IMPLEMENT(OutOfMemoryException, "Out of memory")
EXCEPTION_IMPLEMENT(IOException, "I/O error")
-} // namespace runtime
+} // namespace klay
#include <klay/file-descriptor.h>
-namespace runtime {
+namespace klay {
FileDescriptor::~FileDescriptor()
{
return *this;
}
-} // namespace runtime
+} // namespace klay
#include <klay/file-user.h>
#include <klay/filesystem.h>
-namespace runtime {
+namespace klay {
bool FileUser::isUsedAsFD(const std::string &filePath, const pid_t pid, bool isMount)
{
return list;
}
-} // namespace runtime
+} // namespace klay
#include <klay/exception.h>
#include <klay/filesystem.h>
-namespace runtime {
+namespace klay {
File::File(const std::string& pathname, int flags) :
File(pathname)
}
}
-} // namespace runtime
+} // namespace klay
#define MAX_EPOLL_EVENTS 16
-namespace runtime {
+namespace klay {
Mainloop::Mainloop() :
pollFd(::epoll_create1(EPOLL_CLOEXEC)),
}
}
-} // namespace runtime
+} // namespace klay
#include <klay/exception.h>
#include <klay/namespace.h>
-namespace runtime {
+namespace klay {
namespace {
}
}
-} // namespace runtime
+} // namespace klay
#include <klay/audit/logger.h>
#include <klay/netlink/netlink.h>
+namespace klay {
namespace netlink {
Netlink::Netlink(int protocol) :
}
} // namespace runtime
+} // namespace klay
#include <klay/pam.h>
#include <klay/exception.h>
-namespace runtime {
+namespace klay {
PAM::PAM(const std::string& service, const std::string& user)
{
}
}
-} // namespace runtime
+} // namespace klay
#include <klay/process.h>
#include <klay/exception.h>
-namespace runtime {
+namespace klay {
Process::Process(const std::string& prog) :
status(-1), pid(-1), program(prog)
}
}
-} // namespace runtime
+} // namespace klay
#include <klay/exception.h>
#include <klay/rmi/client.h>
+namespace klay {
namespace rmi {
void DefaultExceptionModel::raise(const std::string& target, const std::string& msg)
}
} // namespace rmi
+} // namespace klay
#include <klay/rmi/connection.h>
+namespace klay {
namespace rmi {
Connection::Connection(Socket&& sock) :
}
} // namespace rmi
+} // namespace klay
#include <klay/audit/logger.h>
#include <klay/rmi/message-composer.h>
+namespace klay {
namespace rmi {
MessageComposer::MessageComposer(size_t caps) :
}
} // namespae rmi
+} // namespae klay
#include <klay/exception.h>
#include <klay/rmi/message.h>
+namespace klay {
namespace rmi {
std::atomic<unsigned int> Message::sequence(0);
}
} // namespace rmi
+} // namespace klay
#include <klay/exception.h>
#include <klay/rmi/notification.h>
+namespace klay {
namespace rmi {
Notification::Notification()
}
} // namespace rmi
+} // namespace klay
#include <klay/rmi/message.h>
#include <klay/audit/logger.h>
+namespace klay {
namespace rmi {
thread_local Service::ProcessingContext Service::processingContext;
}
} // namespace rmi
+} // namespace klay
#include <klay/error.h>
#include <klay/rmi/socket.h>
+namespace klay {
namespace rmi {
namespace {
return Socket(fd);
}
-} // namespace Ipc
+} // namespace rmi
+} // namespace klay
using namespace console;
+namespace klay {
namespace testbench {
Source::Source(const std::string& file, long line, const std::string& msg) :
}
} //namespace testbench
+} //namespace klay
#define __BEGIN_CRITICAL__ { std::unique_lock<std::mutex> lock(this->queueMutex);
#define __END_CRITICAL__ }
-namespace runtime {
+namespace klay {
ThreadPool::ThreadPool(size_t threads)
: stop(false)
condition.notify_one();
}
-} // namespace runtime
+} // namespace klay
#include <klay/xml/document.h>
#include <klay/xml/keepblanks.h>
+namespace klay {
namespace xml {
Document::Document(const std::string& root, const std::string& version) :
}
} // namespace xml
+} // namespace klay
*/
#include <klay/xml/keepblanks.h>
+namespace klay {
namespace xml {
KeepBlanks::KeepBlanks(bool value)
}
} // namespace xml
+} // namespace klay
#include <klay/exception.h>
#include <klay/xml/node.h>
+namespace klay {
namespace xml {
Node::Node(xmlNode* node) :
}
} // namespace xml
+} // namespace klay
#include <klay/xml/parser.h>
#include <klay/xml/keepblanks.h>
+namespace klay {
namespace xml {
Document* Parser::parseContext(xmlParserCtxt* context, bool validate)
}
} // namespace xml
+} // namespace klay