00001 /** 00002 * \file AllPairContainer.h 00003 * \brief Return all pairs from a SingletonContainer 00004 * 00005 * This file is generated by a script (core/tools/make-container). 00006 * Do not edit directly. 00007 * 00008 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00009 */ 00010 00011 #ifndef IMPCONTAINER_ALL_PAIR_CONTAINER_H 00012 #define IMPCONTAINER_ALL_PAIR_CONTAINER_H 00013 00014 #include "container_config.h" 00015 00016 #include <IMP/PairContainer.h> 00017 #include <IMP/SingletonContainer.h> 00018 #include <IMP/container/ListPairContainer.h> 00019 #include <IMP/container/PairContainerSet.h> 00020 00021 IMPCONTAINER_BEGIN_NAMESPACE 00022 00023 //! Return all unordered pairs of particles taken from the SingletonContainer 00024 /** Here is an example using this container to restrain all particles in a set 00025 to be within a a certain distance of one another. 00026 \verbinclude restrain_diameter.py 00027 00028 \note Sequential access is much more efficient than random access which is 00029 suicidally slow for now. Complain if you want fast(er) random access. 00030 We might listen. 00031 00032 \usesconstraint 00033 */ 00034 class IMPCONTAINEREXPORT AllPairContainer : public PairContainer 00035 { 00036 IMP::internal::OwnerPointer<SingletonContainer> c_; 00037 mutable int a_, b_, i_; 00038 friend class AllBipartitePairContainer; 00039 AllPairContainer(SingletonContainer *c, bool); 00040 public: 00041 //! Get the individual particles from the passed SingletonContainer 00042 AllPairContainer(SingletonContainer *c); 00043 00044 static AllPairContainer *create_untracked_container(SingletonContainer *c) { 00045 AllPairContainer *lsc = new AllPairContainer(c, false); 00046 return lsc; 00047 } 00048 00049 IMP_PAIR_CONTAINER(AllPairContainer); 00050 }; 00051 00052 00053 IMPCONTAINER_END_NAMESPACE 00054 00055 #endif /* IMPCONTAINER_ALL_PAIR_CONTAINER_H */