bugprone-virtual-near-miss,
bugprone-unused-raii,
bugprone-use-after-move,
+ cppcoreguidelines-pro-type-const-cast,
+ cppcoreguidelines-slicing,
+ cppcoreguidelines-special-member-functions,
+ cppcoreguidelines-virtual-class-destructor,
google-build-explicit-make-pair,
google-explicit-constructor,
+ misc-const-correctness,
+ misc-misleading-identifier,
+ misc-non-copyable-objects,
+ misc-throw-by-value-catch-by-reference,
+ misc-unused-parameters,
+ misc-unused-using-decls,
modernize-avoid-bind,
modernize-concat-nested-namespaces,
modernize-loop-convert,
modernize-make-shared,
modernize-make-unique,
+ modernize-pass-by-value,
modernize-redundant-void-arg,
+ modernize-replace-auto-ptr,
modernize-replace-random-shuffle,
+ modernize-replace-auto-ptr,
modernize-shrink-to-fit,
modernize-use-bool-literals,
modernize-use-default-member-init,
using scycles_t = int64_t;
using cuptr = std::unique_ptr<const clock_class>;
+ virtual ~clock_class() = default;
+ clock_class(const clock_class&) = delete;
+ clock_class(clock_class&&) = delete;
+ clock_class& operator=(clock_class&&) = delete;
+ clock_class& operator=(const clock_class&) = delete;
+
+ virtual void accept(trace_class_visitor& visitor) const;
+
const std::string name;
const std::string description;
const nonstd::optional<lttng_uuid> uuid;
const scycles_t offset;
const cycles_t frequency;
- virtual void accept(trace_class_visitor& visitor) const;
- virtual ~clock_class() = default;
-
protected:
clock_class(std::string name,
- std::string description,
- nonstd::optional<lttng_uuid> uuid,
- scycles_t offset,
- cycles_t frequency);
+ std::string description,
+ nonstd::optional<lttng_uuid> uuid,
+ scycles_t offset,
+ cycles_t frequency);
};
} /* namespace trace */
class event_class {
public:
- virtual void accept(trace_class_visitor& visitor) const;
+ event_class(const event_class&) = delete;
+ event_class(event_class&&) = delete;
+ event_class& operator=(event_class&&) = delete;
+ event_class& operator=(const event_class&) = delete;
virtual ~event_class() = default;
+ virtual void accept(trace_class_visitor& visitor) const;
+
const unsigned int id;
const unsigned int stream_class_id;
const int log_level;
bool operator==(const type& other) const noexcept;
bool operator!=(const type& other) const noexcept;
+
virtual ~type();
+ type(const type&) = delete;
+ type(type&&) = delete;
+ type& operator=(type&&) = delete;
+ type& operator=(const type&) = delete;
/* Obtain an independent copy of `type`. */
virtual type::cuptr copy() const = 0;
};
class enumeration_type : public integer_type {
+public:
+ ~enumeration_type() override = default;
+ enumeration_type(const enumeration_type&) = delete;
+ enumeration_type(enumeration_type&&) = delete;
+ enumeration_type& operator=(enumeration_type&&) = delete;
+ enumeration_type& operator=(const enumeration_type&) = delete;
+
protected:
enumeration_type(unsigned int alignment,
- enum byte_order byte_order,
- unsigned int size,
- enum signedness signedness,
- enum base base,
- integer_type::roles roles = {});
+ enum byte_order byte_order,
+ unsigned int size,
+ enum signedness signedness,
+ enum base base,
+ integer_type::roles roles = {});
void accept(type_visitor& visitor) const override = 0;
};
public:
using range_t = enumeration_mapping_range<MappingIntegerType>;
- enumeration_mapping(const enumeration_mapping<MappingIntegerType>& other) = default;
- enumeration_mapping(const enumeration_mapping<MappingIntegerType>&& other) noexcept :
- name{ std::move(other.name) }, range{ other.range }
+ enumeration_mapping(std::string in_name, MappingIntegerType value) :
+ name{ std::move(in_name) }, range{ value, value }
{
}
- enumeration_mapping(std::string in_name, MappingIntegerType value) : name{std::move(in_name)}, range{value, value}
+ enumeration_mapping(std::string in_name, range_t in_range) :
+ name{ std::move(in_name) }, range{ in_range }
{
}
- enumeration_mapping(std::string in_name, range_t in_range) : name{std::move(in_name)}, range{in_range}
+ enumeration_mapping(const enumeration_mapping<MappingIntegerType>& other) = default;
+ enumeration_mapping(enumeration_mapping<MappingIntegerType>&& other) noexcept :
+ name{ std::move(other.name) }, range{ other.range }
{
}
+ enumeration_mapping& operator=(enumeration_mapping&&) = delete;
+ enumeration_mapping& operator=(const enumeration_mapping&) = delete;
+ ~enumeration_mapping() = default;
+
const std::string name;
/*
* Only one range per mapping is supported for the moment as
class field_visitor {
public:
virtual ~field_visitor() = default;
+ field_visitor(field_visitor&&) = delete;
+ field_visitor(const field_visitor&) = delete;
+ field_visitor& operator=(const field_visitor&) = delete;
+ field_visitor& operator=(field_visitor&&) = delete;
+
virtual void visit(const field& field) = 0;
protected:
class type_visitor {
public:
virtual ~type_visitor() = default;
+ type_visitor(type_visitor&&) = delete;
+ type_visitor(const type_visitor&) = delete;
+ type_visitor& operator=(const type_visitor&) = delete;
+ type_visitor& operator=(type_visitor&&) = delete;
+
virtual void visit(const integer_type& type) = 0;
virtual void visit(const floating_point_type& type) = 0;
virtual void visit(const signed_enumeration_type& type) = 0;
*/
void accept(trace_class_visitor& visitor) const;
virtual ~stream_class() = default;
+ stream_class(const stream_class&) = delete;
+ stream_class(stream_class&&) = delete;
+ stream_class& operator=(stream_class&&) = delete;
+ stream_class& operator=(const stream_class&) = delete;
virtual const type* packet_context() const;
virtual const type* event_header() const;
class trace_class {
public:
-
virtual ~trace_class() = default;
+ trace_class(const trace_class&) = delete;
+ trace_class(trace_class&&) = delete;
+ trace_class& operator=(trace_class&&) = delete;
+ trace_class& operator=(const trace_class&) = delete;
/*
* Derived classes must implement the _accept_on_*()
class trace_class_environment_visitor {
public:
+ trace_class_environment_visitor() = default;
virtual ~trace_class_environment_visitor() = default;
+ trace_class_environment_visitor(const trace_class_environment_visitor&) = delete;
+ trace_class_environment_visitor(trace_class_environment_visitor&&) = delete;
+ trace_class_environment_visitor& operator=(trace_class_environment_visitor&&) = delete;
+ trace_class_environment_visitor& operator=(const trace_class_environment_visitor&) = delete;
virtual void visit(const environment_field<int64_t>& field) = 0;
virtual void visit(const environment_field<const char *>& field) = 0;
public:
using cuptr = std::unique_ptr<trace_class_visitor>;
+ trace_class_visitor() = default;
virtual ~trace_class_visitor() = default;
+ trace_class_visitor(const trace_class_visitor&) = delete;
+ trace_class_visitor(trace_class_visitor&&) = delete;
+ trace_class_visitor& operator=(trace_class_visitor&&) = delete;
+ trace_class_visitor& operator=(const trace_class_visitor&) = delete;
virtual void visit(const lttng::sessiond::trace::trace_class& trace_class) = 0;
virtual void visit(const lttng::sessiond::trace::clock_class& clock_class) = 0;
end,
session_attributes,
next_ust_ctl_field,
- [&choices, typed_enumeration, &selector_field, quirks](
+ [&choices, &typed_enumeration, &selector_field, quirks](
lst::field::uptr field) {
/*
* Find the enumeration mapping that matches the
const ust_app& app,
uint32_t& out_event_id);
~registry_channel() override;
+ registry_channel(const registry_channel&) = delete;
+ registry_channel(registry_channel&&) = delete;
+ registry_channel& operator=(registry_channel&&) = delete;
+ registry_channel& operator=(const registry_channel&) = delete;
const lttng::sessiond::trace::type *event_context() const final;
void event_context(lttng::sessiond::trace::type::cuptr context);
int loglevel_value,
nonstd::optional<std::string> model_emf_uri);
~registry_event() override = default;
+ registry_event(const registry_event&) = delete;
+ registry_event(registry_event&&) = delete;
+ registry_event& operator=(registry_event&&) = delete;
+ registry_event& operator=(const registry_event&) = delete;
/* Both objd are set by the tracer. */
const int session_objd;
const char *enum_name, uint64_t enum_id) const;
void regenerate_metadata();
+
~registry_session() override;
+ registry_session(const registry_session&) = delete;
+ registry_session(registry_session&&) = delete;
+ registry_session& operator=(registry_session&&) = delete;
+ registry_session& operator=(const registry_session&) = delete;
const lttng::sessiond::trace::type *packet_header() const noexcept override;
registry_enum(std::string name, enum lttng::sessiond::trace::integer_type::signedness signedness);
virtual ~registry_enum() = default;
+ registry_enum(const registry_enum&) = delete;
+ registry_enum(registry_enum&&) = delete;
+ registry_enum& operator=(registry_enum&&) = delete;
+ registry_enum& operator=(const registry_enum&) = delete;
std::string name;
enum lttng::sessiond::trace::integer_type::signedness signedness;
}
file_descriptor(const file_descriptor&) = delete;
+ file_descriptor& operator=(const file_descriptor&) = delete;
+ file_descriptor& operator=(file_descriptor&&) = delete;
file_descriptor(file_descriptor&& other) noexcept {
LTTNG_ASSERT(_is_valid_fd(_raw_fd));
*/
class mutex {
public:
- explicit mutex(pthread_mutex_t& mutex_p) : _mutex{mutex_p}
+ explicit mutex(pthread_mutex_t& mutex_p) : _mutex{ mutex_p }
{
}
+ ~mutex() = default;
+
/* "Not copyable" and "not moveable" Mutex requirements. */
- mutex(mutex const &) = delete;
- mutex &operator=(mutex const &) = delete;
+ mutex(mutex const&) = delete;
+ mutex(mutex&&) = delete;
+ mutex& operator=(mutex const&) = delete;
+ mutex& operator=(mutex&&) = delete;
void lock()
{
*/
class lock_guard {
public:
- explicit lock_guard(pthread_mutex_t& mutex) : _mutex{mutex}, _guard(_mutex)
+ explicit lock_guard(pthread_mutex_t& mutex) : _mutex{ mutex }, _guard(_mutex)
{
}
- lock_guard(const lock_guard &) = delete;
+ ~lock_guard() = default;
+
+ lock_guard(const lock_guard&) = delete;
+ lock_guard(lock_guard&&) = delete;
+ lock_guard& operator=(const lock_guard&) = delete;
+ lock_guard& operator=(lock_guard&&) = delete;
private:
details::mutex _mutex;
* also propagate the scope_exit to another scope, should it be needed.
*/
scope_exit(const scope_exit&) = delete;
+ scope_exit& operator=(const scope_exit&) = delete;
+ scope_exit& operator=(scope_exit&&) = delete;
scope_exit() = delete;
void disarm() noexcept
class read_lock {
public:
read_lock() = default;
+ ~read_lock() = default;
/* "Not copyable" and "not moveable" Mutex requirements. */
- read_lock(read_lock const &) = delete;
- read_lock &operator=(read_lock const &) = delete;
+ read_lock(read_lock const&) = delete;
+ read_lock(read_lock&&) = delete;
+ read_lock& operator=(read_lock&&) = delete;
+ read_lock& operator=(const read_lock&) = delete;
void lock()
{
class read_lock_guard {
public:
read_lock_guard() = default;
+ ~read_lock_guard() = default;
- read_lock_guard(const read_lock_guard &) = delete;
+ read_lock_guard(const read_lock_guard&) = delete;
+ read_lock_guard(read_lock_guard&&) = delete;
+ read_lock_guard& operator=(read_lock_guard&&) = delete;
+ read_lock_guard& operator=(const read_lock_guard&) = delete;
private:
details::read_lock _lock;
- std::lock_guard<details::read_lock> _guard{_lock};
+ std::lock_guard<details::read_lock> _guard{ _lock };
};
using unique_read_lock = std::unique_lock<details::read_lock>;