Changeset 76b9712 in tol
- Timestamp:
- Nov 17, 2008, 3:53:06 PM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 5c9c2d7
- Parents:
- 2b19912
- File:
-
- 1 edited
-
tol/btol/bgrammar/tol_bgencon.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/bgrammar/tol_bgencon.h
r2b19912 r76b9712 236 236 237 237 //-------------------------------------------------------------------- 238 /*! This class provides contens storement 239 */ 240 template <class Any> 241 class TOL_API BGraContensP: public BGraContensBase<Any> 242 //-------------------------------------------------------------------- 243 { 244 protected: 245 Any* contens_; 246 public: 247 BGraContensP() : BGraContensBase<Any>(), contens_(NULL) 248 { 249 TRACE_MEMORY_SHOW(this,"BGraContensP::BGraContensP"); 250 } 251 BGraContensP(Any* any) 252 : BGraContensBase<Any>(), contens_(any) 253 { 254 TRACE_MEMORY_SHOW(this,"BGraContensP::BGraContensP"); 255 } 256 BGraContensP(const BText& name, Any* any) 257 : BGraContensBase<Any>(name), contens_(any) 258 { 259 TRACE_MEMORY_SHOW(this,"BGraContensP::BGraContensP"); 260 } 261 BGraContensP(const BText& name, Any* any, const BText& desc) 262 : BGraContensBase<Any>(name,desc), contens_(any) 263 { 264 TRACE_MEMORY_SHOW(this,"BGraContensP::BGraContensP"); 265 } 266 ~BGraContensP() 267 { 268 DESTROY(contens_); 269 TRACE_MEMORY_SHOW(this,"BGraContensP::~BGraContensP"); 270 } 271 272 void PutContens(const Any& con) 273 { 274 this->flags_.calculated_=BTRUE; 275 *contens_ = con; 276 } 277 278 Any& Contens() 279 { 280 if(!this->flags_.calculated_) { 281 this->CalcContens(); 282 this->flags_.calculated_=BTRUE; 283 } 284 return(*contens_); 285 } 286 BSyntaxObject* CopyContens() 287 { 288 BGraContensP<Any>* copy_ = new BGraContensP<Any>; 289 copy_->PutContens(Contens()); 290 return(copy_); 291 } 292 static BSyntaxObject* New(FILE* fil); 293 294 static BGraContensP<Any>* New(const BText& name, const Any& aux, const BText& desc) 295 { 296 if(name.HasName()) 297 { 298 BGraContensP<Any>* obj = new BGraContensP<Any>("", aux); 299 obj->PutName(name); 300 BGrammar::AddObject(obj); 301 return(obj); 302 } 303 else 304 { 305 return(new BGraContensP<Any>(aux)); 306 } 307 } 308 static BGraContensP<Any>* New(const BText& name, const Any& aux) 309 { 310 if(name.HasName()) 311 { 312 BGraContensP<Any>* obj = new BGraContensP<Any>("", aux); 313 obj->PutName(name); 314 BGrammar::AddObject(obj); 315 return(obj); 316 } 317 else 318 { 319 return(new BGraContensP<Any>(aux)); 320 } 321 } 322 static BGraContensP<Any>* New(const Any& aux) 323 { 324 return(new BGraContensP<Any>(aux)); 325 } 326 DeclareClassNewDelete(BGraContensP<Any>); 327 }; 328 329 330 //-------------------------------------------------------------------- 238 331 /*! This class provides contens storement and Fixed Name and 239 332 * Description (FND). This is usefull to returned objects by
Note: See TracChangeset
for help on using the changeset viewer.
