17 #ifndef _SYSC_TLM_TLM_GP_SHARED_H_
18 #define _SYSC_TLM_TLM_GP_SHARED_H_
28 tlm::tlm_generic_payload* ptr{
nullptr};
37 if(ptr && ptr->has_mm())
43 if(ptr && ptr->has_mm())
48 : ptr(std::move(p.ptr)) {
53 if(ptr && ptr->has_mm())
58 if(ptr && ptr->has_mm())
61 if(ptr && ptr->has_mm())
67 if(ptr && ptr->has_mm())
76 if(ptr && ptr->has_mm())
79 if(ptr && ptr->has_mm())
85 inline tlm::tlm_generic_payload&
operator*() const noexcept {
return *ptr; }
88 inline tlm::tlm_generic_payload*
operator->() const noexcept {
return ptr; }
91 inline tlm::tlm_generic_payload*
get() const noexcept {
return ptr; }
93 inline operator bool() const noexcept {
return ptr !=
nullptr; }
95 inline std::ostream& operator<<(std::ostream& os, tlm_gp_shared_ptr
const& p) {
99 inline bool operator==(tlm_gp_shared_ptr
const& x, tlm_gp_shared_ptr
const& y) noexcept {
return x.get() == y.get(); }
101 inline bool operator==(tlm_gp_shared_ptr
const& x, tlm::tlm_generic_payload* y) noexcept {
return x.get() == y; }
103 inline bool operator!=(tlm_gp_shared_ptr
const& x, tlm_gp_shared_ptr
const& y) noexcept {
return x.get() != y.get(); }
tlm_gp_shared_ptr(tlm_gp_shared_ptr &&p) noexcept
Move constructor.ยด
tlm::tlm_generic_payload * get() const noexcept
Return the stored pointer.
tlm_gp_shared_ptr(tlm_gp_shared_ptr const &p) noexcept
Copy constructor.
tlm::tlm_generic_payload & operator*() const noexcept
Dereference the stored pointer.
tlm::tlm_generic_payload * operator->() const noexcept
Return the stored pointer.
tlm_gp_shared_ptr & operator=(tlm_gp_shared_ptr &&p) noexcept
Move assignment operator.
tlm_gp_shared_ptr & operator=(tlm::tlm_generic_payload *p) noexcept
raw pointer assignment operator.
~tlm_gp_shared_ptr()
destructor
tlm_gp_shared_ptr & operator=(tlm_gp_shared_ptr const &p) noexcept
Copy assignment operator.
tlm_gp_shared_ptr() noexcept=default
Default constructor, creates a unique_ptr that owns nothing.