EMAN2
Public Member Functions | Private Attributes
EMAN::Gatan::TagGroup Class Reference

#include <dm3io.h>

Collaboration diagram for EMAN::Gatan::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

Detailed Description

Definition at line 141 of file dm3io.h.


Constructor & Destructor Documentation

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

Definition at line 523 of file dm3io.cpp.

        :       in(data_file), tagtable(table), name(groupname), entry_id(0)
{
}
TagGroup::~TagGroup ( )

Definition at line 528 of file dm3io.cpp.

{
}

Member Function Documentation

int TagGroup::get_entry_id ( )

Definition at line 565 of file dm3io.cpp.

References entry_id.

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

{
        int id = entry_id;
        entry_id++;
        return id;
}
string TagGroup::get_name ( ) const

Definition at line 560 of file dm3io.cpp.

References name.

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

{
        return name;
}
int TagGroup::read ( bool  nodata = false)

Definition at line 532 of file dm3io.cpp.

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

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

{
        LOGVAR("TagGroup::read()");

        int ntags = 0;
        portable_fseek(in, sizeof(char) * 2, SEEK_CUR);
        
        size_t nr;
        nr = fread(&ntags, sizeof(ntags), 1, in);
        
        ByteOrder::become_big_endian(&ntags);
        
        LOGVAR("DM3: ntags = %d\n", ntags);

        int err = 0;

        for (int i = 0; i < ntags; i++) {
                TagEntry tag_entry(in, tagtable, this);
                err = tag_entry.read(nodata);

                if (err) {
                        break;
                }
        }

        return err;
}

Member Data Documentation

Definition at line 155 of file dm3io.h.

Referenced by get_entry_id().

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

Definition at line 152 of file dm3io.h.

Referenced by read().

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

Definition at line 154 of file dm3io.h.

Referenced by get_name().

Definition at line 153 of file dm3io.h.

Referenced by read().


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