feat():initial version
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class deserializer;
|
||||
|
||||
class deserializable {
|
||||
public:
|
||||
VSOMEIP_EXPORT virtual ~deserializable() { }
|
||||
VSOMEIP_EXPORT virtual bool deserialize(deserializer* _from) = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
75
install/vsomeip-3.7.3/include/vsomeip/internal/logger.hpp
Normal file
75
install/vsomeip-3.7.3/include/vsomeip/internal/logger.hpp
Normal file
@@ -0,0 +1,75 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <ostream>
|
||||
#include <streambuf>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
namespace logger {
|
||||
|
||||
enum class VSOMEIP_IMPORT_EXPORT level_e : std::uint8_t {
|
||||
LL_NONE = 0,
|
||||
LL_FATAL = 1,
|
||||
LL_ERROR = 2,
|
||||
LL_WARNING = 3,
|
||||
LL_INFO = 4,
|
||||
LL_DEBUG = 5,
|
||||
LL_VERBOSE = 6
|
||||
};
|
||||
|
||||
class message : public std::ostream {
|
||||
public:
|
||||
VSOMEIP_IMPORT_EXPORT explicit message(level_e _level);
|
||||
VSOMEIP_IMPORT_EXPORT ~message() override;
|
||||
|
||||
private:
|
||||
std::string_view timestamp() const;
|
||||
std::string_view app_name() const;
|
||||
std::string_view level_as_view() const;
|
||||
std::string_view buffer_as_view() const;
|
||||
|
||||
struct buffer : public std::streambuf {
|
||||
void activate();
|
||||
bool is_active() const;
|
||||
|
||||
std::streambuf::int_type overflow(std::streambuf::int_type c) override;
|
||||
std::streamsize xsputn(const char* s, std::streamsize n) override;
|
||||
|
||||
// The internal storage for the streambuffer. We use this for being able to access data
|
||||
// directly as a string_view. This saving having to allocate a new std::string. The
|
||||
// main use-case is being able to pass data to DLT without unnecessary copying.
|
||||
std::vector<char> data_;
|
||||
bool active_{false};
|
||||
};
|
||||
|
||||
buffer buffer_;
|
||||
const level_e level_;
|
||||
bool console_enabled_{false};
|
||||
bool dlt_enabled_{false};
|
||||
bool file_enabled_{false};
|
||||
std::chrono::system_clock::time_point when_;
|
||||
mutable std::string timestamp_;
|
||||
};
|
||||
|
||||
} // namespace logger
|
||||
} // namespace vsomeip_v3
|
||||
|
||||
#define VSOMEIP_FATAL vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_FATAL)
|
||||
#define VSOMEIP_ERROR vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_ERROR)
|
||||
#define VSOMEIP_WARNING vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_WARNING)
|
||||
#define VSOMEIP_INFO vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_INFO)
|
||||
#define VSOMEIP_DEBUG vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_DEBUG)
|
||||
#define VSOMEIP_TRACE vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_VERBOSE)
|
||||
|
||||
#define VSOMEIP_LOG_DEFAULT_APPLICATION_ID "VSIP"
|
||||
#define VSOMEIP_LOG_DEFAULT_APPLICATION_NAME "vSomeIP application|SysInfra|IPC"
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
#include <vsomeip/plugin.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class plugin_manager {
|
||||
public:
|
||||
VSOMEIP_EXPORT virtual ~plugin_manager(){};
|
||||
VSOMEIP_EXPORT static std::shared_ptr<plugin_manager> get();
|
||||
VSOMEIP_EXPORT virtual std::shared_ptr<plugin> get_plugin(plugin_type_e _type, const std::string& _name) = 0;
|
||||
VSOMEIP_EXPORT virtual void* load_library(const std::string& _path) = 0;
|
||||
VSOMEIP_EXPORT virtual void* load_symbol(void* _handle, const std::string& _symbol) = 0;
|
||||
VSOMEIP_EXPORT virtual void unload_library(void* _handle) = 0;
|
||||
VSOMEIP_EXPORT virtual bool unload_plugin(plugin_type_e _type) = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <vsomeip/deprecated.hpp>
|
||||
#include <vsomeip/export.hpp>
|
||||
#include <vsomeip/primitive_types.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
struct policy;
|
||||
|
||||
class VSOMEIP_IMPORT_EXPORT policy_manager {
|
||||
public:
|
||||
virtual ~policy_manager() { }
|
||||
virtual std::shared_ptr<policy> create_policy() const = 0;
|
||||
virtual void print_policy(const std::shared_ptr<policy>& _policy) const = 0;
|
||||
|
||||
virtual bool parse_uid_gid(const byte_t*& _buffer, uint32_t& _buffer_size, uid_t& _uid, gid_t& _gid) const = 0;
|
||||
virtual bool parse_policy(const byte_t*& _buffer, uint32_t& _buffer_size, uid_t& _uid, gid_t& _gid,
|
||||
const std::shared_ptr<policy>& _policy) const = 0;
|
||||
|
||||
virtual bool is_policy_update_allowed(uid_t _uid, std::shared_ptr<policy>& _policy) const = 0;
|
||||
virtual bool is_policy_removal_allowed(uid_t _uid) const = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class serializer;
|
||||
|
||||
/**
|
||||
* Abstract base class for element that can be serialized.
|
||||
*/
|
||||
class serializable {
|
||||
public:
|
||||
VSOMEIP_EXPORT virtual ~serializable() { }
|
||||
|
||||
/**
|
||||
* \brief serialize the content of the object
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual bool serialize(serializer* _to) const = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
Reference in New Issue
Block a user