From 5427311390b8a1753c0299a5b306ce7cfd4bccd4 Mon Sep 17 00:00:00 2001 From: Sinisa Veseli Date: Sun, 28 Feb 2021 16:28:54 -0600 Subject: [PATCH] initialize PVRecord with access security group/level --- src/database/pvRecord.cpp | 14 ++++++++++---- src/pv/pvDatabase.h | 26 ++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/database/pvRecord.cpp b/src/database/pvRecord.cpp index 3765771..ed2b2be 100644 --- a/src/database/pvRecord.cpp +++ b/src/database/pvRecord.cpp @@ -37,9 +37,11 @@ namespace epics { namespace pvDatabase { PVRecordPtr PVRecord::create( string const &recordName, - PVStructurePtr const & pvStructure) + PVStructurePtr const & pvStructure, + int asLevel, + const std::string& asGroup) { - PVRecordPtr pvRecord(new PVRecord(recordName,pvStructure)); + PVRecordPtr pvRecord(new PVRecord(recordName,pvStructure,asLevel,asGroup)); if(!pvRecord->init()) { pvRecord.reset(); } @@ -49,12 +51,16 @@ PVRecordPtr PVRecord::create( PVRecord::PVRecord( string const & recordName, - PVStructurePtr const & pvStructure) + PVStructurePtr const & pvStructure, + int asLevel_, + const std::string& asGroup_) : recordName(recordName), pvStructure(pvStructure), depthGroupPut(0), traceLevel(0), - isAddListener(false) + isAddListener(false), + asLevel(asLevel_), + asGroup(asGroup_) { } diff --git a/src/pv/pvDatabase.h b/src/pv/pvDatabase.h index 3d9ccd0..f21799d 100644 --- a/src/pv/pvDatabase.h +++ b/src/pv/pvDatabase.h @@ -59,6 +59,7 @@ class epicsShareClass PVRecord : { public: POINTER_DEFINITIONS(PVRecord); + /** * The Destructor. */ @@ -112,11 +113,14 @@ public: * * @param recordName The name of the record, which is also the channelName. * @param pvStructure The top level structure. + * @param asLevel AS level (default: ASL0) + * @param asGroup AS group (default: DEFAULT) * @return A shared pointer to the newly created record. */ static PVRecordPtr create( std::string const & recordName, - epics::pvData::PVStructurePtr const & pvStructure); + epics::pvData::PVStructurePtr const & pvStructure, + int asLevel = 0, const std::string& asGroup = "DEFAULT"); /** * @brief Get the name of the record. * @@ -232,15 +236,30 @@ public: * @param level The level */ void setTraceLevel(int level) {traceLevel = level;} + /** + * @brief Get the ASlevel + * + * @return The level. + */ + int getAsLevel() const {return asLevel;} + /** + * @brief Get the AS group name + * + * @return The name. + */ + std::string getAsGroup() const {return asGroup;} protected: /** * @brief Constructor * @param recordName The name of the record * @param pvStructure The top level PVStructutre + * @param asLevel AS level (default: ASL0) + * @param asGroup AS group (default: DEFAULT) */ PVRecord( std::string const & recordName, - epics::pvData::PVStructurePtr const & pvStructure); + epics::pvData::PVStructurePtr const & pvStructure, + int asLevel = 0, const std::string& asGroup = "DEFAULT"); /** * @brief Initializes the base class. * @@ -269,6 +288,9 @@ private: epics::pvData::PVTimeStamp pvTimeStamp; epics::pvData::TimeStamp timeStamp; + + int asLevel; + std::string asGroup; }; epicsShareFunc std::ostream& operator<<(std::ostream& o, const PVRecord& record);