00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: TrkView.h,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $ 00004 // 00005 // Description: 00006 // Class TrkView. Simple struct to hold view information 00007 // in a bit 00008 // 00009 // Environment: 00010 // Software developed for the BaBar Detector at the SLAC B-Factory. 00011 // 00012 // Copyright Infomation; 00013 // Copyright (C) 2002 Lawrence Berkeley Laboratory 00014 // 00015 // Author(s): Dave Brown 10/25/02 00016 // 00017 //------------------------------------------------------------------------ 00018 00019 #ifndef TRKVIEW_H 00020 #define TRKVIEW_H 00021 00022 #include "TrkBase/TrkEnums.h" 00023 00024 class TrkView { 00025 public: 00026 // construct from a view 00027 TrkView(TrkEnums::TrkViewInfo view=TrkEnums::noView); 00028 // construct from data 00029 TrkView(unsigned short& data); 00030 // copy and equivalence are OK 00031 TrkView(const TrkView&); 00032 TrkView& operator =(const TrkView&); 00033 virtual ~TrkView(); 00034 // allow adding views 00035 void addView(TrkEnums::TrkViewInfo view); 00036 // accessor 00037 TrkEnums::TrkViewInfo view() const; 00038 // logical operations 00039 bool contains(const TrkView& other) const; 00040 bool contains(TrkEnums::TrkViewInfo view) const; 00041 bool operator == (const TrkView& other) const; 00042 bool operator != (const TrkView& other) const; 00043 // direct accessor for binary comparisons 00044 unsigned short viewData() const { return _view; } 00045 private: 00046 unsigned short _view; 00047 // some useful statics; make them public so they can be used 00048 public: 00049 static const unsigned short _xyview; 00050 static const unsigned short _zview; 00051 static const unsigned short _bothview; 00052 }; 00053 00054 #endif