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

#include <dm4io.h>

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

Public Member Functions

 TagGroup (FILE *data_file, TagTable *tagtable, const string &groupname)
 
 ~TagGroup ()
 
int read_tag_group (bool nodata=false, int image_index=0, int num_images=1)
 
string get_name () const
 
int get_entry_id ()
 

Private Attributes

FILE * in
 
TagTabletagtable
 
string name
 
int entry_id
 

Detailed Description

Definition at line 141 of file dm4io.h.

Constructor & Destructor Documentation

◆ TagGroup()

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

Definition at line 674 of file dm4io.cpp.

675 : in(data_file), tagtable(table), name(groupname), entry_id(0)
676{
677}
TagTable * tagtable
Definition: dm4io.h:153

◆ ~TagGroup()

TagGroup::~TagGroup ( )

Definition at line 679 of file dm4io.cpp.

680{
681}

Member Function Documentation

◆ get_entry_id()

int TagGroup::get_entry_id ( )

Definition at line 733 of file dm4io.cpp.

734{
735 int id = entry_id;
736 entry_id++;
737 return id;
738}

References entry_id.

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

◆ get_name()

string TagGroup::get_name ( ) const

Definition at line 728 of file dm4io.cpp.

729{
730 return name;
731}

References name.

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

◆ read_tag_group()

int TagGroup::read_tag_group ( bool  nodata = false,
int  image_index = 0,
int  num_images = 1 
)

Definition at line 683 of file dm4io.cpp.

684{
685 LOGVAR("TagGroup::read_tag_group()");
686 char is_sorted, is_open;
687
688 long long ntags = 0;
689
690// portable_fseek(in, sizeof(char) * 2, SEEK_CUR);
691 size_t nr;
692 nr = fread(&is_sorted, sizeof(is_sorted), 1, in); nr++;
693 nr = fread(&is_open, sizeof(is_open), 1, in); nr++;
694
695 nr = fread(&ntags, sizeof(ntags), 1, in); nr++;
696
698
699 LOGVAR("DM4: ntags = %d\n", ntags);
700
701 int err = 0;
702 // char flagend;
703 for (int i = 0; i < ntags; i++) {
704 /*
705 portable_fseek(in, sizeof(char) * 9, SEEK_CUR);
706 nr = fread(&flagend, sizeof(char), 1, in); nr++;
707
708 if (flagend ==EOF){
709 break;
710 }
711 else{
712 portable_fseek(in, -sizeof(char) * 10, SEEK_CUR);;
713 }
714
715 */
716
717 TagEntry tag_entry(in, tagtable, this);
718 err = tag_entry.read_tag_entry(nodata, image_index, num_images);
719
720 if (err) {
721 break;
722 }
723 }
724
725 return err;
726}
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

References EMAN::ByteOrder::become_big_endian(), in, LOGVAR, EMAN::GatanDM4::TagEntry::read_tag_entry(), and tagtable.

Referenced by EMAN::DM4IO::get_nimg(), and EMAN::GatanDM4::TagEntry::read_tag_entry().

Member Data Documentation

◆ entry_id

int EMAN::GatanDM4::TagGroup::entry_id
private

Definition at line 155 of file dm4io.h.

Referenced by get_entry_id().

◆ in

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

Definition at line 152 of file dm4io.h.

Referenced by read_tag_group().

◆ name

string EMAN::GatanDM4::TagGroup::name
private

Definition at line 154 of file dm4io.h.

Referenced by get_name().

◆ tagtable

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

Definition at line 153 of file dm4io.h.

Referenced by read_tag_group().


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