Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:09

0001 #ifndef FWCore_SOA_ColumnValues_h
0002 #define FWCore_SOA_ColumnValues_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/SOA
0006 // Class  :     ColumnValues
0007 //
0008 /**\class ColumnValues ColumnValues.h "ColumnValues.h"
0009 
0010  Description: Provides container like access to a column of a Table
0011 
0012  Usage:
0013 
0014 */
0015 //
0016 // Original Author:  Chris Jones
0017 //         Created:  Thu, 24 Aug 2017 18:13:38 GMT
0018 //
0019 
0020 // system include files
0021 
0022 // user include files
0023 
0024 // forward declarations
0025 #include <cstddef>
0026 namespace edm {
0027   namespace soa {
0028 
0029     template <typename T>
0030     class ColumnValues {
0031     public:
0032       ColumnValues(T const* iBegin, size_t iSize) : m_begin(iBegin), m_end(iBegin + iSize) {}
0033 
0034       T const* begin() const { return m_begin; }
0035       T const* end() const { return m_end; }
0036 
0037     private:
0038       T const* m_begin = nullptr;
0039       T const* m_end = nullptr;
0040     };
0041 
0042     template <typename T>
0043     class MutableColumnValues {
0044     public:
0045       MutableColumnValues(T* iBegin, size_t iSize) : m_begin(iBegin), m_end(iBegin + iSize) {}
0046 
0047       T* begin() const { return m_begin; }
0048       T* end() const { return m_end; }
0049 
0050     private:
0051       T* m_begin = nullptr;
0052       T* m_end = nullptr;
0053     };
0054 
0055   }  // namespace soa
0056 }  // namespace edm
0057 
0058 #endif