OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librtcltools/] [RtclOPtr.ipp] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 wfjm
// $Id: RtclOPtr.ipp 488 2013-02-16 18:49:47Z mueller $
2 10 wfjm
//
3
// Copyright 2011- by Walter F.J. Mueller 
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
//
14
// Revision History:
15
// Date         Rev Version  Comment
16
// 2011-02-20   363   1.0    Initial version
17
// ---------------------------------------------------------------------------
18
 
19
/*!
20
  \file
21 19 wfjm
  \version $Id: RtclOPtr.ipp 488 2013-02-16 18:49:47Z mueller $
22 10 wfjm
  \brief   Implemenation (inline) of RtclOPtr.
23
*/
24
 
25
/*!
26
  \class Retro::RtclOPtr
27
  \brief FIXME_docs
28
*/
29
 
30 19 wfjm
// all method definitions in namespace Retro
31 10 wfjm
namespace Retro {
32
 
33
//------------------------------------------+-----------------------------------
34
//! Default constructor
35
 
36
inline RtclOPtr::RtclOPtr()
37
  : fpObj(0)
38
{}
39
 
40
//------------------------------------------+-----------------------------------
41
//! FIXME_docs
42
 
43
inline RtclOPtr::RtclOPtr(Tcl_Obj* pobj)
44
  : fpObj(pobj)
45
{
46
  if (fpObj) Tcl_IncrRefCount(fpObj);
47
}
48
 
49
//------------------------------------------+-----------------------------------
50
//! FIXME_docs
51
 
52
inline RtclOPtr::RtclOPtr(const RtclOPtr& rhs)
53
  : fpObj(rhs.fpObj)
54
{
55
  if (fpObj) Tcl_IncrRefCount(fpObj);
56
}
57
 
58
//------------------------------------------+-----------------------------------
59
//! Destructor
60
 
61
inline RtclOPtr::~RtclOPtr()
62
{
63
  if (fpObj) Tcl_DecrRefCount(fpObj);
64
}
65
 
66
//------------------------------------------+-----------------------------------
67
//! FIXME_docs
68
 
69
inline RtclOPtr::operator Tcl_Obj*() const
70
{
71
  return fpObj;
72
}
73
 
74
//------------------------------------------+-----------------------------------
75
//! FIXME_docs
76
 
77
inline bool RtclOPtr::operator !() const
78
{
79
  return fpObj==0;
80
}
81
 
82
//------------------------------------------+-----------------------------------
83
//! FIXME_docs
84
 
85
inline RtclOPtr& RtclOPtr::operator=(const RtclOPtr& rhs)
86
{
87
  if (&rhs == this) return *this;
88
  return operator=(rhs.fpObj);
89
}
90
 
91
//------------------------------------------+-----------------------------------
92
//! FIXME_docs
93
 
94
inline RtclOPtr& RtclOPtr::operator=(Tcl_Obj* pobj)
95
{
96
  if (fpObj) Tcl_DecrRefCount(fpObj);
97
  fpObj = pobj;
98
  if (fpObj) Tcl_IncrRefCount(fpObj);
99
  return *this;
100
}
101
 
102
} // end namespace Retro

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.