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

/magnus/back_end/SessionManager/include/BaseProperties.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: BaseProperties.h,v 1.2 2001/02/05 22:21:07 bormotov Exp $
00003  */
00004  
00005 //   Copyright (C) 1998 The New York Group Theory Cooperative
00006 //   See magnus/doc/COPYRIGHT for the full notice.
00007  
00008 // Contents: Definition of base properties.
00009 //
00010 // Principal Author: Dmitry Pechkin
00011 //
00012 // Status: In progress.
00013 //
00014 // Revision History:
00015 //
00016 // Special Notes:
00017 //
00018 // Further implementation steps:
00019 //
00020 // Bugs:
00021 //
00022 //
00023 
00024 #ifndef _BASE_PROPERTIES_H_
00025 #define _BASE_PROPERTIES_H_
00026 
00027 #include "Property.h"
00028  
00029 #include "Associations.h"
00030 #include "QuickAssociations.h"
00031 #include "Chars.h"
00032 #include "APofFreeGroups.h"
00033 #include "FreeByCyclic.h"
00034 #include "MSCGroup.h"
00035 #include "Automorphism.h"
00036 #include "HNNExtOfFreeGroup.h"
00037 #include "NilpotentGroup.h"
00038 #include "CosetEnumerator.h"
00039 #include "DFSA.h"
00040 #include "DiffMachine.h"
00041 #include "KBMachine.h"
00042 #include "DecomposeInSubgroup.h"
00043 #include "AbelianSGPresentation.h"
00044 #include "SGOfNilpotentGroup.h"
00045 #include "PolyWord.h"
00046 
00047 //============================================================
00048 //
00049 //          Simple properties:
00050 //
00051 //============================================================
00052 
00053 class NoData {};
00054 //  I/O stubs
00055 inline istream& operator>>( const istream&, const NoData& ) {}
00056 inline ostream& operator<<( const ostream&, const NoData& ) {}
00057  
00058 
00059 /*
00060 class $A$Property : public SimpleProperty< $S$ > {
00061 public:
00062   $S$Property( const $S$& data, const Chars& descr = Chars() ) 
00063     : SimpleProperty< $S$ >(data, descr) {}
00064 };
00065 */
00066 
00067 
00068 class NoDataProperty : public SimpleProperty<NoData> {
00069 public:
00070   NoDataProperty( const Chars& descr = Chars() ) 
00071     : SimpleProperty<NoData>(NoData(), descr) {}
00072 };
00073 
00074 class BoolProperty : public SimpleProperty<bool> {
00075 public:
00076   BoolProperty( const bool& data, const Chars& descr = Chars() ) 
00077     : SimpleProperty<bool>(data, descr) {}
00078 };
00079 
00080 class IntProperty : public SimpleProperty<int> {
00081 public:
00082   IntProperty( const int& data, const Chars& descr = Chars() ) 
00083     : SimpleProperty<int>(data, descr) {}
00084 };
00085 
00086 
00087 //class CharsProperty : public SimpleProperty<Chars> {
00088 //public:
00089 //  CharsProperty(const Chars& str) : SimpleProperty<>(str) {}
00090 //  void readFrom(istream& istr); 
00091 //  void writeTo(ostream& ostr) const;
00092 //};
00093 
00094 inline istream& operator>>( istream& istr, Word& w ) {
00095   error("Called a stub for: istream& operator>>(istream&,Word&)");
00096 }           
00097 //@dp just a stub. we don't use it.
00098  
00099 class WordProperty : public SimpleProperty<Word> {
00100 public:
00101   WordProperty( const Word& data, const Chars& descr = Chars() ) 
00102     : SimpleProperty<Word>(data,descr) {}
00103   void readFrom(istream& istr)      { istr > theData; }
00104   void writeTo(ostream& ostr) const { ostr < theData; }
00105 };
00106 
00107 
00108 inline istream& operator>>( istream& istr, PolyWord& w ) {
00109   error("Called a stub for: istream& operator>>(istream&,Word&)");
00110 }
00111 //@dp just a stub. we don't use it.
00112 
00113 class PolyWordProperty : public SimpleProperty<PolyWord> {
00114 public:
00115   PolyWordProperty( const PolyWord& data, const Chars& descr = Chars() ) 
00116     : SimpleProperty<PolyWord>(data,descr) {}
00117   void readFrom(istream& istr)      { istr > theData; }
00118   void writeTo(ostream& ostr) const { ostr < theData; }
00119 };
00120 
00121 class IntegerProperty : public SimpleProperty<Integer> {
00122 public:
00123   IntegerProperty( const Integer& data, const Chars& descr = Chars() ) 
00124     : SimpleProperty<Integer>(data, descr) {}
00125 };
00126 
00127 
00128 class SMFPCheckinTypeProperty : public SimpleProperty<int> {
00129 public:
00130   SMFPCheckinTypeProperty( const int& data, const Chars& descr = Chars() ) 
00131     : SimpleProperty<int>(data, descr) {}
00132 };
00133 
00134 class FPGroupProperty : public SimpleProperty<FPGroup> {
00135 public:
00136   FPGroupProperty( const FPGroup& data, const Chars& descr = Chars() ) 
00137     : SimpleProperty<FPGroup>(data, descr) {} 
00138 };
00139 
00140 class FreeGroupProperty : public SimpleProperty<FreeGroup> {
00141 public:
00142   FreeGroupProperty( const FreeGroup& data, const Chars& descr = Chars() ) 
00143     : SimpleProperty<FreeGroup>(data, descr) {}
00144 };
00145 
00146 
00147 class MSCGroupPtr 
00148 {
00149 public:
00150 
00151   MSCGroupPtr( const MSCGroupPtr& G );
00152   ~MSCGroupPtr();
00153 
00154   const MSCGroup& getMSCG() const;
00155 
00156 private:
00157 
00158   friend class SimpleProperty<MSCGroupPtr>;
00159   friend class MSCGroupProperty;
00160   //friend class GIC;
00161 
00162   MSCGroupPtr( const FPGroup& G, int lmbda );
00163   MSCGroupPtr& operator= ( const MSCGroupPtr& G );
00164 
00165   friend istream& operator>>(istream& istr, MSCGroupPtr& G);
00166   friend ostream& operator<<(ostream& ostr, const MSCGroupPtr& G );
00167   // Data members:
00168   FPGroup fp;
00169   int lambda;
00170   MSCGroup *msc;
00171 private:
00172   MSCGroupPtr();
00173 };
00174 
00175 class MSCGroupProperty : public SimpleProperty<MSCGroupPtr> {
00176 public:
00177   MSCGroupProperty(const FPGroup& G, int lambda, const Chars& descr = Chars());
00178 };
00179 
00180 class FreeByCyclicProperty : public SimpleProperty<FreeByCyclic> {
00181 public:
00182   FreeByCyclicProperty(const FreeByCyclic& data, const Chars& descr = Chars()) 
00183     : SimpleProperty<FreeByCyclic>(data, descr) {}
00184 };
00185 
00186 class AmalgProductOfFreeGroupsProperty :
00187   public SimpleProperty<AmalgProductOfFreeGroups> {
00188 public:
00189   AmalgProductOfFreeGroupsProperty(const AmalgProductOfFreeGroups& data, 
00190                                    const Chars& descr = Chars() ) 
00191     : SimpleProperty<AmalgProductOfFreeGroups>(data, descr) {}
00192 };
00193 
00194 class HNNExtOfFreeGroupProperty : public SimpleProperty<HNNExtOfFreeGroup> {
00195 public:
00196   HNNExtOfFreeGroupProperty( const HNNExtOfFreeGroup& data, 
00197                              const Chars& descr = Chars() ) 
00198     : SimpleProperty<HNNExtOfFreeGroup>(data, descr) {}
00199 };
00200 
00201 class MapProperty : public SimpleProperty<Map> {
00202 public:
00203   MapProperty( const Map& data, const Chars& descr = Chars() ) 
00204     : SimpleProperty<Map>(data, descr) {}
00205 };
00206 
00207 //============================================================
00208 //
00209 //          Complex properties:
00210 //
00211 //============================================================
00212 
00213 /*
00214  *  // Template for complex base property:
00215  *
00216 
00217 class $C$Property : public ComplexProperty< $C$ > {
00218 public:
00219   $C$Property( const $C$& data, const Chars& descr = Chars() ) 
00220     : ComplexProperty< $C$ >(data, descr) {}
00221 protected:
00222   void readFrom(istream& istr)       { istr > theData; }
00223   void writeTo (ostream& ostr) const { ostr < theData; }
00224 };
00225 
00226  *
00227  */
00228 
00229 //inline istream& operator>>( istream& istr, AbelianGroup& G ){}   //@dp imp!
00230 //  error("Called a stub for: istream& operator>>(istream&,Word&)");
00231 //}
00232 //@dp just a stub. we don't use it.
00233 // dummy stub.
00234 
00235 class AbelianGroupProperty : public ComplexProperty< AbelianGroup > {
00236 public:
00237   AbelianGroupProperty(const AbelianGroup& data, const Chars& descr = Chars()) 
00238     : ComplexProperty<AbelianGroup>(data, descr) {}
00239 protected:
00240   void readFrom(istream& istr)       { istr > theData; }
00241   void writeTo (ostream& ostr) const { ostr < theData; }
00242 };
00243 
00244 class NilpotentGroupProperty : public ComplexProperty<NilpotentGroup> {
00245 public:
00246   NilpotentGroupProperty( const NilpotentGroup& data, 
00247                           const Chars& descr = Chars() ) 
00248     : ComplexProperty<NilpotentGroup>(data, descr) {}
00249 protected:
00250   void readFrom(istream& istr);
00251   void writeTo (ostream& ostr);
00252 };
00253 
00254 class NilpGroupAssocProperty : 
00255   public ComplexProperty< AssociationsOf<int,NilpotentGroup*> > 
00256 {
00257 public:
00258   NilpGroupAssocProperty( const AssociationsOf<int,NilpotentGroup*>& data, 
00259                           const Chars& descr = Chars() ) 
00260     : ComplexProperty< AssociationsOf<int,NilpotentGroup*> >(data, descr) {}
00261 
00262   NilpGroupAssocProperty( const NilpGroupAssocProperty& P );
00263   const NilpGroupAssocProperty& operator=( const NilpGroupAssocProperty& P );
00264   ~NilpGroupAssocProperty();
00265 
00266 protected:
00267   void unbindAll();
00268   void copyAll( const NilpGroupAssocProperty& P );
00269   
00270   void readFrom(istream& istr);
00271   void writeTo(ostream& ostr) const ;
00272 };
00273 
00274 
00275 class SubgroupGraphProperty : public ComplexProperty<SubgroupGraph> {
00276 public:
00277   SubgroupGraphProperty( const SubgroupGraph& data, 
00278                          const Chars& descr = Chars() ) 
00279     : ComplexProperty<SubgroupGraph>(data, descr) {}
00280 protected:
00281   void readFrom(istream& istr)      { istr > theData; }
00282   void writeTo(ostream& ostr) const { ostr < theData; }
00283 };
00284 
00285 class PermutationRepresentationProperty : 
00286   public ComplexProperty<PermutationRepresentation> {
00287 public:
00288   PermutationRepresentationProperty( const PermutationRepresentation& data, 
00289                                      const Chars& descr = Chars() ) 
00290     : ComplexProperty<PermutationRepresentation>(data, descr) {}
00291 protected:
00292   void readFrom(istream& istr)      { istr > theData; }
00293   void writeTo(ostream& ostr) const { ostr < theData; }
00294 };
00295 
00296 class GroupDFSAProperty : public ComplexProperty<GroupDFSA> {
00297 public:
00298   GroupDFSAProperty( const GroupDFSA& data, const Chars& descr = Chars() ) 
00299     : ComplexProperty<GroupDFSA>(data, descr) {}
00300 protected:
00301   void readFrom(istream& istr)      { istr > theData; }
00302   void writeTo(ostream& ostr) const { ostr < theData; }
00303 };
00304 
00305 class DiffMachineProperty : public ComplexProperty<DiffMachine> {
00306 public:
00307   DiffMachineProperty( const DiffMachine& data, const Chars& descr = Chars() )
00308     : ComplexProperty<DiffMachine>(data, descr) {}
00309 protected:
00310   void readFrom(istream& istr)      { istr > theData; }
00311   void writeTo(ostream& ostr) const { ostr < theData; }
00312 };
00313 
00314 //@dp This property should be insvestigated more about data saved to and restored from
00315 //    a disk storage. Now it stores itself in a wrong way.
00316 ///   And we don't want to store this property on the disk at all now.
00317 
00318 class KBMachineProperty : public UnstorableProperty<KBMachine> {
00319 public:
00320   KBMachineProperty( const KBMachine& data, const Chars& descr = Chars() )
00321     : UnstorableProperty<KBMachine>( data, descr ) {}
00322 };
00323 
00324 /*@dp The future implementation of KBMachineProperty may look like this:
00325 
00326 class KBMachineProperty : public ComplexProperty<KBMachine> {
00327 public:
00328   KBMachineProperty( const KBMachine& data, const Chars& descr = Chars() )
00329     : ComplexProperty<KBMachine>(data, descr) {}
00330 protected:
00331   void readFrom(istream& istr)      { istr > theData; }
00332   void writeTo(ostream& ostr) const { ostr < theData; }
00333 };
00334 */
00335 
00336 class DecomposeInSubgroupOfFPGroupProperty : 
00337   public ComplexProperty<DecomposeInSubgroupOfFPGroup> 
00338 {
00339 public:
00340   DecomposeInSubgroupOfFPGroupProperty( 
00341     const DecomposeInSubgroupOfFPGroup& data, const Chars& descr = Chars() 
00342   ) : ComplexProperty<DecomposeInSubgroupOfFPGroup>(data, descr) {}
00343 
00344 protected:
00345   void readFrom(istream& istr)      { istr > theData; }
00346   void writeTo(ostream& ostr) const { ostr < theData; }
00347 };
00348 
00349 class ListOfEndomorphismProperty : 
00350   public ComplexProperty< ListOf<Endomorphism> > 
00351 {
00352 public:
00353   ListOfEndomorphismProperty( const ListOf<Endomorphism> & data, 
00354                               const Chars& descr = Chars() ) 
00355     : ComplexProperty< ListOf<Endomorphism> >(data, descr) {}
00356 protected:
00357   void readFrom(istream& istr);
00358   void writeTo (ostream& ostr) const;
00359 };
00360 
00361 class ListOfAutomorphismProperty : 
00362   public ComplexProperty< ListOf<Automorphism> > {
00363 public:
00364   ListOfAutomorphismProperty( const ListOf<Automorphism> & data, 
00365                               const Chars& descr = Chars() ) 
00366     : ComplexProperty< ListOf<Automorphism> >(data, descr) {}
00367 protected:
00368     void readFrom(istream& istr);
00369     void writeTo (ostream& ostr) const;
00370 };
00371 
00372 class AbelianSGPresentationProperty : 
00373   public ComplexProperty<AbelianSGPresentation> {
00374 public:
00375   AbelianSGPresentationProperty( const AbelianSGPresentation& data, 
00376                                  const Chars& descr = Chars() ) 
00377     : ComplexProperty<AbelianSGPresentation>(data, descr) {}
00378 protected:
00379   void readFrom(istream& istr)      { istr > theData; }
00380   void writeTo(ostream& ostr) const { ostr < theData; }
00381 };
00382 
00383 class SGOfNilpotentGroupProperty : public ComplexProperty<SGOfNilpotentGroup> {
00384 public:
00385   SGOfNilpotentGroupProperty( const SGOfNilpotentGroup& data, 
00386                               const Chars& descr = Chars() ) 
00387     : ComplexProperty<SGOfNilpotentGroup>(data, descr) {}
00388 
00389 protected:
00390   void readFrom(istream& istr);
00391   void writeTo(ostream& ostr) const;
00392 };
00393 
00394 class SGNilpGroupAssocProperty : 
00395   public ComplexProperty< AssociationsOf<int,SGOfNilpotentGroup*> > 
00396 {
00397 public:
00398   SGNilpGroupAssocProperty(const AssociationsOf<int,SGOfNilpotentGroup*>& data,
00399                            const Chars& descr = Chars() ) 
00400     : ComplexProperty< AssociationsOf<int,SGOfNilpotentGroup*> >(data, descr){}
00401 
00402   SGNilpGroupAssocProperty( const SGNilpGroupAssocProperty& P );
00403   const SGNilpGroupAssocProperty& operator=( const SGNilpGroupAssocProperty& P );
00404   ~SGNilpGroupAssocProperty();
00405 
00406 protected:
00407   void unbindAll();
00408   void copyAll( const SGNilpGroupAssocProperty& P );
00409   
00410   void readFrom(istream& istr);
00411   void writeTo(ostream& ostr) const ;
00412 };
00413 
00414 //============================================================
00415 //
00416 //          User defined properties:
00417 //
00418 //============================================================
00419 
00420 /*
00421 class <D>Property : public <B>Property {
00422 public:
00423   <D>Property(const <B>& data, const Chars& descr) 
00424     : <B>Property(data, descr) {}
00425   PropertyType actualType()   const { return type(); }
00426   static PropertyType type() { return theTypeID; }
00427   Chars propertyName() const { return "<D>"; }
00428 protected:
00429   GenericProperty* clone() const { return new <D>Property(*this); }
00430 private:
00431   static const PropertyType theTypeID;
00432 };
00433 */
00434 
00435 #endif

Generated at Tue Jun 19 09:49:37 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001