w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RtclOPtr.ipp
Go to the documentation of this file.
1// $Id: RtclOPtr.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2011-02-20 363 1.0 Initial version
8// ---------------------------------------------------------------------------
9
19// all method definitions in namespace Retro
20namespace Retro {
21
22//------------------------------------------+-----------------------------------
24
26 : fpObj(nullptr)
27{}
28
29//------------------------------------------+-----------------------------------
31
32inline RtclOPtr::RtclOPtr(Tcl_Obj* pobj)
33 : fpObj(pobj)
34{
35 if (fpObj) Tcl_IncrRefCount(fpObj);
36}
37
38//------------------------------------------+-----------------------------------
40
41inline RtclOPtr::RtclOPtr(const RtclOPtr& rhs)
42 : fpObj(rhs.fpObj)
43{
44 if (fpObj) Tcl_IncrRefCount(fpObj);
45}
46
47//------------------------------------------+-----------------------------------
49
51{
52 if (fpObj) Tcl_DecrRefCount(fpObj);
53}
54
55//------------------------------------------+-----------------------------------
57
58inline RtclOPtr::operator Tcl_Obj*() const
59{
60 return fpObj;
61}
62
63//------------------------------------------+-----------------------------------
65
66inline bool RtclOPtr::operator !() const
67{
68 return fpObj==nullptr;
69}
70
71//------------------------------------------+-----------------------------------
73
75{
76 if (&rhs == this) return *this;
77 return operator=(rhs.fpObj);
78}
79
80//------------------------------------------+-----------------------------------
82
83inline RtclOPtr& RtclOPtr::operator=(Tcl_Obj* pobj)
84{
85 if (fpObj) Tcl_DecrRefCount(fpObj);
86 fpObj = pobj;
87 if (fpObj) Tcl_IncrRefCount(fpObj);
88 return *this;
89}
90
91} // end namespace Retro
Implemenation (inline) of RtclOPtr.
Definition: RtclOPtr.hpp:23
~RtclOPtr()
Destructor.
Definition: RtclOPtr.ipp:50
bool operator!() const
FIXME_docs.
Definition: RtclOPtr.ipp:66
Tcl_Obj * fpObj
pointer to tcl object
Definition: RtclOPtr.hpp:36
RtclOPtr()
Default constructor.
Definition: RtclOPtr.ipp:25
RtclOPtr & operator=(const RtclOPtr &rhs)
FIXME_docs.
Definition: RtclOPtr.ipp:74
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47