Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

fieldstruct.cpp

Go to the documentation of this file.
00001 //****************************************************
00002 //  April, 1993, University of Illinois
00003 // Copyright (C) 1993, 1994 Tianlin Wang
00004 /* Copyright (C) 1994-2003 Matvec Development Team. 
00005 
00006   This program is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Library General Public
00008   License as published by the Free Software Foundation; either
00009   version 2 of the License, or (at your option) any later version.
00010   
00011   This program is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Library General Public License for more details.
00015     
00016   You should have received a copy of the GNU Library General Public
00017   License along with this library; if not, write to the Free
00018   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00019   MA 02111-1307, USA 
00020 */
00021 
00022 #include "fieldstruct.h"
00023 
00024 namespace matvec {
00025 
00026 int fieldindex(const std::string &fw,const FieldStruct* field_vec,const unsigned n)
00027 {
00028    int k = -1;
00029    for (unsigned i=0; i<n; i++) {
00030       if (field_vec[i].name() == fw) {
00031          k = i; break;
00032       }
00033    }
00034    return k;
00035 }
00036 
00037 FieldStruct::FieldStruct(const FieldStruct& A) {copyfrom(A);}
00038 
00039 void FieldStruct::copyfrom(const FieldStruct& A)
00040 {
00041    if (this == &A) return;
00042    mytype   = A.mytype;
00043    myclassi = A.myclassi;
00044    mynlevel = A.mynlevel;
00045    mynmiss  = A.mynmiss;
00046    myindex  = A.myindex;
00047    myname   = A.myname;
00048 }
00049 
00050 const FieldStruct& FieldStruct::operator=(const FieldStruct& A)
00051 {
00052    copyfrom(A);
00053    return *this;
00054 }
00055 
00056 } ///////// end of namespace matvec
00057 

Generated on Thu Jun 16 17:13:40 2005 for Matvec by doxygen1.2.16