#include "idep_nameindexmap.h"
#include "idep_namearray.h"
#include <string.h>
#include <memory.h>
#include <iostream>
#include <cassert>
Go to the source code of this file.
Classes | |
struct | idep_NameIndexMapLink |
struct | idep_NameIndexMap_i |
Enumerations | |
enum | { DEFAULT_TABLE_SIZE = 521 } |
enum | { BAD_INDEX = -1 } |
Functions | |
static unsigned | hash (register const char *name) |
static const idep_NameIndexMapLink * | find (const idep_NameIndexMapLink *p, const char *name) |
std::ostream & | operator<< (std::ostream &out, const idep_NameIndexMap &map) |
anonymous enum |
Definition at line 12 of file idep_nimap.cxx.
00012 { DEFAULT_TABLE_SIZE = 521 };
anonymous enum |
static const idep_NameIndexMapLink* find | ( | const idep_NameIndexMapLink * | p, | |
const char * | name | |||
) | [static] |
Definition at line 43 of file idep_nimap.cxx.
References idep_NameIndexMapLink::d_name_p, and idep_NameIndexMapLink::d_next_p.
Referenced by Anp::LocalFit::Add(), idep_NameIndexMap::add(), BDSwicCalibrator::AddDevice(), PerInputStream::AddFile(), IoInputStreamItr::AddFile(), IoDataStreamItr::AddFile(), Anp::RunFinder::AddIndex(), LatticeBase::addLeftNodeToLink(), LatticeBase::addRightNodeToLink(), IoOutputModule::AddStreams(), PreFilter::Ana(), IoOutputModule::AttachAssociatedStreams(), RootUtil::FileFinder::CheckFileName(), Anp::CleanRecord(), LatticeBase::cLshared(), Anp::RunFinder::Compress(), GeoMediumMap::ConfigureMedium(), LatticeBase::connect(), LatticeBase::connectLinks(), ClusterListKG::CreateClusters(), Anp::Truth::DataAt(), Anp::TrueNu::DataAt(), Anp::Track::DataAt(), Anp::Strip::DataAt(), Anp::Record::DataAt(), Anp::RecoNu::DataAt(), Anp::Event::DataAt(), ConvergenceMaster::MaskStep::DecrementPlaneCount(), NavSet::Detach(), NueUtilities::Histograms::DoesSetExist(), IoOutputModule::EnableStreamList(), idep_NameIndexMap::entry(), Anp::TrueNu::Erase(), Anp::RecoNu::Erase(), Anp::FillkNN::Fill(), AtNuShieldPerformance::FillEvent(), NueUtilities::Histograms::FillHisto(), Zbeam::FillVector(), Anp::Truth::Find(), Anp::ReadTree< T >::Find(), Anp::FillkNN::Find(), ConvergenceMaster::MaskStep::FindPlaneCountMax(), ConvergenceMaster::MaskStep::FindPlaneCountMin(), Anp::FillkNN::Get(), Anp::FillBasic::Get(), Anp::Interface::GetData(), NueUtilities::Histograms::GetHistogram(), Zbeam::GetWeight(), IoDataStreamItr::GoToFile(), ConvergenceMaster::MaskStep::IncrementPlaneCount(), Anp::FillkNN::Init(), LatticeRightNode::isLinkedTo(), LatticeLeftNode::isLinkedTo(), Anp::Truth::KeyExists(), Anp::TrueNu::KeyExists(), Anp::Track::KeyExists(), Anp::Strip::KeyExists(), Anp::Record::KeyExists(), Anp::RecoNu::KeyExists(), Anp::Event::KeyExists(), LatticeBase::leftNode(), DbmLogFile::LogRec(), idep_NameIndexMap::lookup(), main(), TruthHelp::MakeAssociateHits(), NueUtilities::Histograms::MakeHisto(), Anp::TrueNu::Match(), Anp::Strip::MatchEvt(), Anp::Event::MatchShower(), Anp::Strip::MatchShw(), Anp::Strip::MatchSlc(), Anp::Event::MatchTrack(), Anp::Strip::MatchTrk(), LatticeBase::newLeftNode(), LatticeBase::newRightNode(), Anp::CountAboveBelow::operator()(), parse_path(), Anp::SelectSpill::PassList(), Anp::SelectFiducial::PassTruth(), Anp::PlotShortSelect::Plot(), GuiCompositeFrameBase::Remove(), PerInputStream::RemoveFile(), IoFileListItem::RemoveFile(), IoDataStreamItr::RemoveFile(), DemoSnarlList::RemoveRunSnarl(), IoOutputModule::RemoveStreams(), NueUtilities::Histograms::RetrieveHistogram(), LatticeBase::rightNode(), Anp::SelectFiducial::Run(), Anp::PlotEff::Run(), Anp::FillSnarl::Run(), Anp::FillNPlane::Run(), Anp::FillEvent::Run(), LatticeBase::shareLinksLeft(), LatticeBase::shareLinksRight(), LatticeRightNode::sharesLinksWith(), LatticeLeftNode::sharesLinksWith(), LatticeBase::sLLshared(), LatticeBase::sLRshared(), IoInputStreamItr::Streams(), ConvergenceMaster::UnsetEverySecond(), and NueUtilities::Histograms::WriteHisto().
static unsigned hash | ( | register const char * | name | ) | [static] |
Definition at line 15 of file idep_nimap.cxx.
Referenced by idep_NameIndexMap_i::findSlot().
00015 : returns unsigned! 00016 { 00017 register unsigned sum = 1000003; // 1,000,003 is the 78,498th prime number 00018 while (*name) { 00019 sum *= *name++; // integer multiplication is a subroutine on a SPARC 00020 } 00021 return sum; // unsigned ensures positive value for use with (%) operator. 00022 }
std::ostream& operator<< | ( | std::ostream & | out, | |
const idep_NameIndexMap & | map | |||
) |
Definition at line 149 of file idep_nimap.cxx.
References idep_NameIndexMap::length().
00150 { 00151 int fieldWidth = 10; 00152 int maxIndex = map.length() - 1; 00153 assert (sizeof (long int) >= 4); 00154 long int x = 1000 * 1000 * 1000; // requires 4-byte integer. 00155 while (fieldWidth > 1 && 0 == maxIndex / x) { 00156 --fieldWidth; 00157 x /= 10; 00158 } 00159 00160 for (int i = 0; i < map.length(); ++i) { 00161 out.width(fieldWidth); 00162 out << i << ". " << map[i] << std::endl; 00163 } 00164 00165 return out; 00166 }