Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
skhaz committed Oct 30, 2023
1 parent f5ed041 commit 10e097d
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 1 deletion.
62 changes: 61 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,64 @@
{
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 2, TabWidth: 2, BreakBeforeBraces: Attach, AllowShortIfStatementsOnASingleLine: true, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -2 }"
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 2, TabWidth: 2, BreakBeforeBraces: Attach, AllowShortIfStatementsOnASingleLine: true, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -2 }",
"files.associations": {
"__bit_reference": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__verbose_abort": "cpp",
"array": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"forward_list": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"locale": "cpp",
"mutex": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"queue": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"variant": "cpp",
"vector": "cpp",
"algorithm": "cpp"
}
}
18 changes: 18 additions & 0 deletions src/eventmanager.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once
#ifndef _eventmanager_hpp_
#define _eventmanager_hpp_

Check warning on line 3 in src/eventmanager.hpp

View workflow job for this annotation

GitHub Actions / lint

/src/eventmanager.hpp:3:9 [bugprone-reserved-identifier]

declaration uses identifier '_eventmanager_hpp_', which is reserved in the global namespace

#include "common.hpp"
#include "noncopyable.hpp"

class event_manager : private noncopyable {

Check warning on line 8 in src/eventmanager.hpp

View workflow job for this annotation

GitHub Actions / lint

/src/eventmanager.hpp:8:7 [cppcoreguidelines-special-member-functions]

class 'event_manager' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator
public:
event_manager() = default;
~event_manager() = default;

void add_listener(std::shared_pre<eventlistener> listener);

void remove_listener(std::function<eventlistener> listener);
}

#endif
14 changes: 14 additions & 0 deletions src/noncopyable.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once
#ifndef _noncopyable_hpp_
#define _noncopyable_hpp_

Check warning on line 3 in src/noncopyable.hpp

View workflow job for this annotation

GitHub Actions / lint

/src/noncopyable.hpp:3:9 [bugprone-reserved-identifier]

declaration uses identifier '_noncopyable_hpp_', which is reserved in the global namespace

class noncopyable {

Check warning on line 5 in src/noncopyable.hpp

View workflow job for this annotation

GitHub Actions / lint

/src/noncopyable.hpp:5:7 [cppcoreguidelines-special-member-functions]

class 'noncopyable' defines a default destructor, a copy constructor and a copy assignment operator but does not define a move constructor or a move assignment operator
public:
noncopyable() = default;
~noncopyable() = default;

noncopyable(const noncopyable &) = delete;
noncopyable &operator=(const noncopyable &) = delete;

Check warning on line 11 in src/noncopyable.hpp

View workflow job for this annotation

GitHub Actions / lint

/src/noncopyable.hpp:11:16 [modernize-use-trailing-return-type]

use a trailing return type for this function
};

#endif

0 comments on commit 10e097d

Please sign in to comment.