xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
trace_listener_collection.h
Go to the documentation of this file.
1 #pragma once
5 #include <memory>
6 #include <vector>
7 #include "trace_listener.h"
8 
10 namespace xtd {
12  namespace diagnostics {
19  class trace_listener_collection : public std::vector<std::shared_ptr<xtd::diagnostics::trace_listener>> {
20  public:
22  using base = std::vector<value_type>;
23 
27  explicit trace_listener_collection(const allocator_type& allocator = allocator_type());
30  trace_listener_collection(const std::initializer_list<value_type>& il);
32  trace_listener_collection(const base& collection);
34  trace_listener_collection& operator=(const trace_listener_collection& collection);
36  bool operator==(const trace_listener_collection& value) const;
37  bool operator!=(const trace_listener_collection& value) const;
39 
40  using base::operator[];
56  const_reference operator[](const xtd::ustring& name) const;
72  reference operator[](const xtd::ustring& name);
73 
74  private:
75  inline static value_type empty_;
76  };
77  }
78 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
std::vector< value_type > base
Represents the base type of the collection.
Definition: trace_listener_collection.h:22
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
trace_listener_collection(const allocator_type &allocator=allocator_type())
Creates a new object xtd::diagnostics::trace_listener_collection with specified allocator (optional)...
Represents a collection of xtd::diagnostics::trace_listener.
Definition: trace_listener_collection.h:19
Contains xtd::diagnostics::trace_listener listener.
const_reference operator[](const xtd::ustring &name) const
Gets the first xtd::diagnostics::trace_listener in the list with the specified name.