pva2pva 1.4.2
Loading...
Searching...
No Matches
pdbRecordIterator Struct Reference

Public Member Functions

 pdbRecordIterator (const dbChannel *chan)
bool done () const
bool next ()
dbCommon * record () const
const char * name () const
const char * info (const char *key, const char *def=0)

Public Attributes

DBENTRY ent
bool m_done

Detailed Description

Definition at line 137 of file pvif.h.

Constructor & Destructor Documentation

◆ pdbRecordIterator() [1/2]

pdbRecordIterator::pdbRecordIterator ( )
inline

Definition at line 140 of file pvif.h.

141 {
142 dbInitEntry(pdbbase, &ent);
143 m_done = dbFirstRecordType(&ent)!=0;
144 while(!m_done) {
145 if(dbFirstRecord(&ent)==0)
146 break;
147 // not instances of this type
148 m_done = dbNextRecordType(&ent)!=0;
149 }
150 }

◆ pdbRecordIterator() [2/2]

pdbRecordIterator::pdbRecordIterator ( const dbChannel * chan)
inline

Definition at line 151 of file pvif.h.

152 {
153#if EPICS_VERSION_INT>=VERSION_INT(3,16,1,0)
154 dbInitEntryFromRecord(dbChannelRecord(chan), &ent);
155#else
156 dbInitEntry(pdbbase, &ent);
157 if(dbFindRecord(&ent, dbChannelRecord(chan)->name)!=0)
158 throw std::logic_error("Record not found");
159#endif
160 m_done = false;
161 }

◆ ~pdbRecordIterator()

pdbRecordIterator::~pdbRecordIterator ( )
inline

Definition at line 169 of file pvif.h.

170 {
171 dbFinishEntry(&ent);
172 }

Member Function Documentation

◆ done()

bool pdbRecordIterator::done ( ) const
inline

Definition at line 173 of file pvif.h.

173{ return m_done; }

◆ info()

const char * pdbRecordIterator::info ( const char * key,
const char * def = 0 )
inline

Definition at line 194 of file pvif.h.

195 {
196 if(m_done || dbFindInfo(&ent, key))
197 return def;
198 return dbGetInfoString(&ent);
199 }

◆ name()

const char * pdbRecordIterator::name ( ) const
inline

Definition at line 191 of file pvif.h.

191 {
192 return m_done ? NULL : ent.precnode->recordname;
193 }

◆ next()

bool pdbRecordIterator::next ( )
inline

Definition at line 174 of file pvif.h.

174 {
175 if(!m_done && dbNextRecord(&ent)!=0)
176 {
177 // done with this recordType
178 while(true) {
179 m_done = dbNextRecordType(&ent)!=0;
180 if(m_done) break;
181 if(dbFirstRecord(&ent)==0)
182 break;
183 // not instances of this type
184 }
185 }
186 return m_done;
187 }

◆ record()

dbCommon * pdbRecordIterator::record ( ) const
inline

Definition at line 188 of file pvif.h.

188 {
189 return m_done ? NULL : (dbCommon*)ent.precnode->precord;
190 }

Member Data Documentation

◆ ent

DBENTRY pdbRecordIterator::ent

Definition at line 138 of file pvif.h.

◆ m_done

bool pdbRecordIterator::m_done

Definition at line 139 of file pvif.h.


The documentation for this struct was generated from the following file: