00001
00002
00011 #ifndef ATHCONTAINERS_AUXSTOREINTERNAL_H
00012 #define ATHCONTAINERS_AUXSTOREINTERNAL_H
00013
00014
00015 #include "AthContainersInterfaces/IAuxStore.h"
00016 #include "AthContainersInterfaces/IAuxStoreIO.h"
00017 #include "AthContainers/tools/threading.h"
00018 #include "CxxUtils/override.h"
00019 #include <vector>
00020
00021
00022 namespace SG {
00023
00024
00025 class IAuxTypeVector;
00026
00027
00039 class AuxStoreInternal
00040 : public IAuxStore, public IAuxStoreIO
00041 {
00042 public:
00047 AuxStoreInternal (bool standalone = false);
00048
00049
00055 virtual ~AuxStoreInternal();
00056
00057
00061 AuxStoreInternal (const AuxStoreInternal& orig);
00062
00063
00067 bool standalone() const;
00068
00069
00080 virtual const void* getData (SG::auxid_t auxid) const ATH_OVERRIDE;
00081
00082
00099 virtual void* getData (SG::auxid_t auxid, size_t size, size_t capacity)
00100 ATH_OVERRIDE;
00101
00102
00124 virtual void* getDecoration (auxid_t auxid, size_t size, size_t capacity)
00125 ATH_OVERRIDE;
00126
00127
00139 virtual void resize (size_t sz) ATH_OVERRIDE;
00140
00141
00150 virtual void reserve (size_t sz) ATH_OVERRIDE;
00151
00152
00175 virtual void shift (size_t pos, ptrdiff_t offs) ATH_OVERRIDE;
00176
00177
00185 virtual const SG::auxid_set_t& getAuxIDs() const ATH_OVERRIDE;
00186
00187
00194 virtual const SG::auxid_set_t& getWritableAuxIDs() const ATH_OVERRIDE;
00195
00196
00207 virtual const void* getIOData (SG::auxid_t auxid) const ATH_OVERRIDE;
00208
00209
00221 virtual const std::type_info* getIOType (SG::auxid_t auxid) const ATH_OVERRIDE;
00222
00223
00227 virtual const SG::auxid_set_t& getDynamicAuxIDs() const ATH_OVERRIDE;
00228
00229
00236 virtual void lock() ATH_OVERRIDE;
00237
00238
00246 virtual void clearDecorations() ATH_OVERRIDE;
00247
00248
00254 virtual size_t size() const ATH_OVERRIDE;
00255
00256
00266 virtual bool setOption (auxid_t id, const AuxDataOption& option) ATH_OVERRIDE;
00267
00268
00269 protected:
00281 const void* getIODataInternal (auxid_t auxid, bool quiet) const;
00282
00283
00288 void addAuxID (auxid_t auxid);
00289
00290
00308 virtual void* getDataInternal (SG::auxid_t auxid,
00309 size_t size,
00310 size_t capacity,
00311 bool no_lock_check);
00312
00313
00314 private:
00316 bool m_standalone;
00317
00320 std::vector<IAuxTypeVector*> m_vecs;
00321
00323 std::vector<bool> m_isDecoration;
00324
00325
00326
00327 #ifndef __REFLEX__
00329 SG::auxid_set_t m_auxids;
00330 #endif
00331
00333 size_t m_tick;
00334
00336 bool m_locked;
00337
00339 typedef AthContainers_detail::mutex mutex_t;
00340 typedef AthContainers_detail::lock_guard<mutex_t> guard_t;
00341 mutable mutex_t m_mutex;
00342
00344 struct TSAuxidSet
00345 {
00346 size_t m_tick;
00347 auxid_set_t m_set;
00348 TSAuxidSet (size_t tick, const auxid_set_t& set)
00349 : m_tick (tick), m_set (set) {}
00350 };
00351 mutable AthContainers_detail::thread_specific_ptr<TSAuxidSet> m_tsAuxids;
00352
00353
00354 private:
00355
00356 AuxStoreInternal& operator= (const AuxStoreInternal&);
00357 };
00358
00359
00360 }
00361
00362
00363
00364 #ifndef XAOD_STANDALONE
00365
00366 #include "SGTools/BaseInfo.h"
00367 #include "SGTools/CLASS_DEF.h"
00368 SG_BASE( SG::AuxStoreInternal, SG::IAuxStore );
00369 CLASS_DEF( SG::AuxStoreInternal , 16428258 , 1 )
00370
00371 #endif // not XAOD_STANDALONE
00372
00373
00374 #endif // not ATHCONTAINERS_AUXSTOREINTERNAL_H