Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EMAN::GatanDM4::TagGroup Class Reference

#include <dm4io.h>

Collaboration diagram for EMAN::GatanDM4::TagGroup:

Collaboration graph
[legend]
List of all members.

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

Constructor & Destructor Documentation

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

Definition at line 633 of file dm4io.cpp.

References in.

00634         :       in(data_file), tagtable(table), name(groupname), entry_id(0)
00635 {
00636 }

TagGroup::~TagGroup  ) 
 

Definition at line 638 of file dm4io.cpp.

00639 {
00640 }


Member Function Documentation

int TagGroup::get_entry_id  ) 
 

Definition at line 688 of file dm4io.cpp.

References entry_id.

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

00689 {
00690         int id = entry_id;
00691         entry_id++;
00692         return id;
00693 }

string TagGroup::get_name  )  const
 

Definition at line 683 of file dm4io.cpp.

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

00684 {
00685         return name;
00686 }

int TagGroup::read bool  nodata = false  ) 
 

Definition at line 642 of file dm4io.cpp.

References in, LOGVAR, portable_fseek(), EMAN::GatanDM4::TagEntry::read(), and tagtable.

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

00643 {
00644         LOGVAR("TagGroup::read()");
00645 
00646         long ntags = 0;
00647         
00648         portable_fseek(in, sizeof(char) * 2, SEEK_CUR);
00649 
00650         fread(&ntags, sizeof(ntags), 1, in);
00651         
00652         ByteOrder::become_big_endian(&ntags);
00653 
00654         LOGVAR("DM4: ntags = %d\n", ntags);
00655 
00656         int err = 0;
00657         char flagend;
00658         for (int i = 0; i < ntags; i++) {
00659                 /*
00660                 portable_fseek(in, sizeof(char) * 9, SEEK_CUR);
00661                 fread(&flagend, sizeof(char), 1, in);
00662                 
00663                 if (flagend ==EOF){
00664                         break;
00665                 }
00666                 else{
00667                         portable_fseek(in, -sizeof(char) * 10, SEEK_CUR);;
00668                 }
00669                 
00670                 */
00671                 
00672                 TagEntry tag_entry(in, tagtable, this);
00673                 err = tag_entry.read(nodata);
00674 
00675                 if (err) {
00676                         break;
00677                 }
00678         }
00679 
00680         return err;
00681 }


Member Data Documentation

int EMAN::GatanDM4::TagGroup::entry_id [private]
 

Definition at line 154 of file dm4io.h.

Referenced by get_entry_id().

FILE* EMAN::GatanDM4::TagGroup::in [private]
 

Definition at line 151 of file dm4io.h.

Referenced by read().

string EMAN::GatanDM4::TagGroup::name [private]
 

Definition at line 153 of file dm4io.h.

TagTable* EMAN::GatanDM4::TagGroup::tagtable [private]
 

Definition at line 152 of file dm4io.h.

Referenced by read().


The documentation for this class was generated from the following files:
Generated on Tue Jun 11 13:49:54 2013 for EMAN2 by  doxygen 1.3.9.1