EMAN2
Public Member Functions | Private Attributes | List of all members
EMAN::Gatan::TagGroup Class Reference

#include <dm3io.h>

Collaboration diagram for EMAN::Gatan::TagGroup:
Collaboration graph
[legend]

Public Member Functions

 TagGroup (FILE *data_file, TagTable *tagtable, const string &groupname)
 
 ~TagGroup ()
 
int read (bool nodata=false)
 
string get_name () const
 
int get_entry_id ()
 

Private Attributes

FILE * in
 
TagTabletagtable
 
string name
 
int entry_id
 

Detailed Description

Definition at line 137 of file dm3io.h.

Constructor & Destructor Documentation

◆ TagGroup()

TagGroup::TagGroup ( FILE *  data_file,
TagTable tagtable,
const string &  groupname 
)

Definition at line 519 of file dm3io.cpp.

520 : in(data_file), tagtable(table), name(groupname), entry_id(0)
521{
522}
TagTable * tagtable
Definition: dm3io.h:149

◆ ~TagGroup()

TagGroup::~TagGroup ( )

Definition at line 524 of file dm3io.cpp.

525{
526}

Member Function Documentation

◆ get_entry_id()

int TagGroup::get_entry_id ( )

Definition at line 561 of file dm3io.cpp.

562{
563 int id = entry_id;
564 entry_id++;
565 return id;
566}

References entry_id.

Referenced by EMAN::Gatan::TagEntry::read().

◆ get_name()

string TagGroup::get_name ( ) const

Definition at line 556 of file dm3io.cpp.

557{
558 return name;
559}

References name.

Referenced by EMAN::Gatan::TagEntry::read().

◆ read()

int TagGroup::read ( bool  nodata = false)

Definition at line 528 of file dm3io.cpp.

529{
530 LOGVAR("TagGroup::read()");
531
532 int ntags = 0;
533 portable_fseek(in, sizeof(char) * 2, SEEK_CUR);
534
535 size_t nr;
536 nr = fread(&ntags, sizeof(ntags), 1, in); nr++;
537
539
540 LOGVAR("DM3: ntags = %d\n", ntags);
541
542 int err = 0;
543
544 for (int i = 0; i < ntags; i++) {
545 TagEntry tag_entry(in, tagtable, this);
546 err = tag_entry.read(nodata);
547
548 if (err) {
549 break;
550 }
551 }
552
553 return err;
554}
static void become_big_endian(T *data, size_t n=1)
convert data from host byte order to big endian order.
Definition: byteorder.h:112
#define LOGVAR
Definition: log.h:57
int portable_fseek(FILE *fp, off_t offset, int whence)

References EMAN::ByteOrder::become_big_endian(), in, LOGVAR, portable_fseek(), EMAN::Gatan::TagEntry::read(), and tagtable.

Referenced by EMAN::Gatan::TagEntry::read().

Member Data Documentation

◆ entry_id

int EMAN::Gatan::TagGroup::entry_id
private

Definition at line 151 of file dm3io.h.

Referenced by get_entry_id().

◆ in

FILE* EMAN::Gatan::TagGroup::in
private

Definition at line 148 of file dm3io.h.

Referenced by read().

◆ name

string EMAN::Gatan::TagGroup::name
private

Definition at line 150 of file dm3io.h.

Referenced by get_name().

◆ tagtable

TagTable* EMAN::Gatan::TagGroup::tagtable
private

Definition at line 149 of file dm3io.h.

Referenced by read().


The documentation for this class was generated from the following files: