serialize.hh (10338:8bee5f4edb92) | serialize.hh (10453:d0365cc3d05f) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 241 unchanged lines hidden (view full) --- 250// Macros to encapsulate the magic of declaring & defining 251// SerializableBuilder and SerializableClass objects 252// 253 254#define REGISTER_SERIALIZEABLE(CLASS_NAME, OBJ_CLASS) \ 255SerializableClass the##OBJ_CLASS##Class(CLASS_NAME, \ 256 OBJ_CLASS::createForUnserialize); 257 | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 241 unchanged lines hidden (view full) --- 250// Macros to encapsulate the magic of declaring & defining 251// SerializableBuilder and SerializableClass objects 252// 253 254#define REGISTER_SERIALIZEABLE(CLASS_NAME, OBJ_CLASS) \ 255SerializableClass the##OBJ_CLASS##Class(CLASS_NAME, \ 256 OBJ_CLASS::createForUnserialize); 257 |
258// Base class to wrap object resolving functionality. This can be 259// provided to Checkpoint to allow it to map object names onto 260// object C++ objects in which to unserialize 261class SimObjectResolver 262{ 263 public: 264 virtual ~SimObjectResolver() { } 265 266 // Find a SimObject given a full path name 267 virtual SimObject *resolveSimObject(const std::string &name) = 0; 268}; 269 |
|
258class Checkpoint 259{ 260 private: 261 262 IniFile *db; 263 | 270class Checkpoint 271{ 272 private: 273 274 IniFile *db; 275 |
276 SimObjectResolver &objNameResolver; 277 |
|
264 public: | 278 public: |
265 Checkpoint(const std::string &cpt_dir); | 279 Checkpoint(const std::string &cpt_dir, SimObjectResolver &resolver); |
266 ~Checkpoint(); 267 268 const std::string cptDir; 269 270 bool find(const std::string §ion, const std::string &entry, 271 std::string &value); 272 273 bool findObj(const std::string §ion, const std::string &entry, --- 32 unchanged lines hidden --- | 280 ~Checkpoint(); 281 282 const std::string cptDir; 283 284 bool find(const std::string §ion, const std::string &entry, 285 std::string &value); 286 287 bool findObj(const std::string §ion, const std::string &entry, --- 32 unchanged lines hidden --- |