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

Subversion Repositories w11

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 wfjm
// $Id: RtclGet.ipp 488 2013-02-16 18:49:47Z mueller $
2
//
3
// Copyright 2013- 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
// 2013-02-12   487   1.0    Initial version
17
// ---------------------------------------------------------------------------
18
 
19
/*!
20
  \file
21
  \version $Id: RtclGet.ipp 488 2013-02-16 18:49:47Z mueller $
22
  \brief   Implemenation (inline) of class RtclGet.
23
*/
24
 
25
/*!
26
  \class Retro::RtclGet
27
  \brief FIXME_docs
28
*/
29
 
30
// all method definitions in namespace Retro
31
namespace Retro {
32
 
33
//------------------------------------------+-----------------------------------
34
//! FIXME_docs
35
 
36
template 
37
inline RtclGet::RtclGet(const boost::function& get)
38
  : fGet(get)
39
{}
40
 
41
//------------------------------------------+-----------------------------------
42
//! FIXME_docs
43
 
44
template 
45
inline RtclGet::~RtclGet()
46
{}
47
 
48
//------------------------------------------+-----------------------------------
49
//! FIXME_docs
50
 
51
template <>
52
inline Tcl_Obj* RtclGet::operator()() const
53
{
54
  bool val = fGet();
55
  return Tcl_NewBooleanObj((int)val);
56
}
57
 
58
//------------------------------------------+-----------------------------------
59
//! FIXME_docs
60
 
61
template <>
62
inline Tcl_Obj* RtclGet::operator()() const
63
{
64
  char val = fGet();
65
  return Tcl_NewIntObj((int)val);
66
}
67
 
68
//------------------------------------------+-----------------------------------
69
//! FIXME_docs
70
 
71
template <>
72
inline Tcl_Obj* RtclGet::operator()() const
73
{
74
  signed char val = fGet();
75
  return Tcl_NewIntObj((int)val);
76
}
77
 
78
//------------------------------------------+-----------------------------------
79
//! FIXME_docs
80
 
81
template <>
82
inline Tcl_Obj* RtclGet::operator()() const
83
{
84
  unsigned char val = fGet();
85
  return Tcl_NewIntObj((int)val);
86
}
87
 
88
//------------------------------------------+-----------------------------------
89
//! FIXME_docs
90
 
91
template <>
92
inline Tcl_Obj* RtclGet::operator()() const
93
{
94
  short val = fGet();
95
  return Tcl_NewIntObj((int)val);
96
}
97
 
98
//------------------------------------------+-----------------------------------
99
//! FIXME_docs
100
 
101
template <>
102
inline Tcl_Obj* RtclGet::operator()() const
103
{
104
  unsigned short val = fGet();
105
  return Tcl_NewIntObj((int)val);
106
}
107
 
108
//------------------------------------------+-----------------------------------
109
//! FIXME_docs
110
 
111
template <>
112
inline Tcl_Obj* RtclGet::operator()() const
113
{
114
  int val = fGet();
115
  return Tcl_NewIntObj(val);
116
}
117
 
118
//------------------------------------------+-----------------------------------
119
//! FIXME_docs
120
 
121
template <>
122
inline Tcl_Obj* RtclGet::operator()() const
123
{
124
  unsigned int val = fGet();
125
  return Tcl_NewIntObj((int)val);
126
}
127
 
128
//------------------------------------------+-----------------------------------
129
//! FIXME_docs
130
 
131
template <>
132
inline Tcl_Obj* RtclGet::operator()() const
133
{
134
  long val = fGet();
135
  return Tcl_NewLongObj(val);
136
}
137
 
138
//------------------------------------------+-----------------------------------
139
//! FIXME_docs
140
 
141
template <>
142
inline Tcl_Obj* RtclGet::operator()() const
143
{
144
  unsigned long val = fGet();
145
  return Tcl_NewLongObj((long)val);
146
}
147
 
148
//------------------------------------------+-----------------------------------
149
//! FIXME_docs
150
 
151
template <>
152
inline Tcl_Obj* RtclGet::operator()() const
153
{
154
  float val = fGet();
155
  return Tcl_NewDoubleObj(val);
156
}
157
 
158
//------------------------------------------+-----------------------------------
159
//! FIXME_docs
160
 
161
template <>
162
inline Tcl_Obj* RtclGet::operator()() const
163
{
164
  double val = fGet();
165
  return Tcl_NewDoubleObj(val);
166
}
167
 
168
//------------------------------------------+-----------------------------------
169
//! FIXME_docs
170
 
171
template <>
172
inline Tcl_Obj* RtclGet::operator()() const
173
{
174
  std::string val = fGet();
175
  return Tcl_NewStringObj((char*) val.data(), val.length());
176
}
177
 
178
//------------------------------------------+-----------------------------------
179
//! FIXME_docs
180
 
181
template <>
182
inline Tcl_Obj* RtclGet::operator()() const
183
{
184
  std::string val = fGet();
185
  return Tcl_NewStringObj((char*) val.data(), val.length());
186
}
187
 
188
} // end namespace Retro
189
 

powered by: WebSVN 2.1.0

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