comparison UnitTestsSources/SQLiteTests.cpp @ 2924:22524fd06225

macros ORTHANC_OVERRIDE and ORTHANC_FINAL
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Nov 2018 09:06:46 +0100
parents 878b59270859
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2923:87366b8aed4f 2924:22524fd06225
140 MyFunc() 140 MyFunc()
141 { 141 {
142 destroyed = false; 142 destroyed = false;
143 } 143 }
144 144
145 virtual ~MyFunc() 145 virtual ~MyFunc() ORTHANC_OVERRIDE
146 { 146 {
147 destroyed = true; 147 destroyed = true;
148 } 148 }
149 149
150 virtual const char* GetName() const 150 virtual const char* GetName() const ORTHANC_OVERRIDE
151 { 151 {
152 return "MYFUNC"; 152 return "MYFUNC";
153 } 153 }
154 154
155 virtual unsigned int GetCardinality() const 155 virtual unsigned int GetCardinality() const ORTHANC_OVERRIDE
156 { 156 {
157 return 2; 157 return 2;
158 } 158 }
159 159
160 virtual void Compute(SQLite::FunctionContext& context) 160 virtual void Compute(SQLite::FunctionContext& context) ORTHANC_OVERRIDE
161 { 161 {
162 context.SetIntResult(1000 + context.GetIntValue(0) * context.GetIntValue(1)); 162 context.SetIntResult(1000 + context.GetIntValue(0) * context.GetIntValue(1));
163 } 163 }
164 }; 164 };
165 165
166 class MyDelete : public SQLite::IScalarFunction 166 class MyDelete : public SQLite::IScalarFunction
167 { 167 {
168 public: 168 public:
169 std::set<int> deleted_; 169 std::set<int> deleted_;
170 170
171 virtual const char* GetName() const 171 virtual const char* GetName() const ORTHANC_OVERRIDE
172 { 172 {
173 return "MYDELETE"; 173 return "MYDELETE";
174 } 174 }
175 175
176 virtual unsigned int GetCardinality() const 176 virtual unsigned int GetCardinality() const ORTHANC_OVERRIDE
177 { 177 {
178 return 1; 178 return 1;
179 } 179 }
180 180
181 virtual void Compute(SQLite::FunctionContext& context) 181 virtual void Compute(SQLite::FunctionContext& context) ORTHANC_OVERRIDE
182 { 182 {
183 deleted_.insert(context.GetIntValue(0)); 183 deleted_.insert(context.GetIntValue(0));
184 context.SetNullResult(); 184 context.SetNullResult();
185 } 185 }
186 }; 186 };