00001 /** 00002 * \file IMP/container_base.h 00003 * \brief Abstract base class for containers of particles. 00004 * 00005 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00006 * 00007 */ 00008 00009 #ifndef IMP_CONTAINER_BASE_H 00010 #define IMP_CONTAINER_BASE_H 00011 00012 #include "kernel_config.h" 00013 #include "Object.h" 00014 #include "macros.h" 00015 00016 IMP_BEGIN_NAMESPACE 00017 00018 class Particle; 00019 IMP_OBJECTS(Particle); 00020 /** \objects{Particle} 00021 */ 00022 /** \objectstemp{Particle} 00023 */ 00024 00025 class Container; 00026 IMP_OBJECTS(Container); 00027 /** \objects{Container} 00028 */ 00029 /** \objectstemp{Container} 00030 */ 00031 00032 //! Abstract class for containers of particles 00033 /** Containers store sets of tuples of particles. The degree of the tuple 00034 (i.e. whether each tuple contains one, two, three or four 00035 particles) is constant for each container. That is, a 00036 SingletonContainer is a set of single particles, a PairContainer 00037 is a set of pairs of particles etc. 00038 00039 These sets can come from a variety of sources, such as 00040 - user-provided lists, e.g. IMP::core::ListSingletonContainer 00041 - operations on other containers e.g. IMP::core::PairContainerSet 00042 - computations based on particle attributes 00043 e.g. IMP::Core::ClosePairContainer 00044 00045 Containers provide a variety of methods to 00046 - get the number of tuples 00047 - get the ith tuple 00048 - iterate through the tuples 00049 - determine if a tuple is contained in the set 00050 00051 \note Containers store \em sets and so are fundamentally unordered. 00052 */ 00053 class IMPEXPORT Container : public Object 00054 { 00055 public: 00056 Container(std::string name="Container %1%"); 00057 00058 //! Get the set of containers read by this one 00059 virtual ContainersTemp get_input_containers() const=0; 00060 //! Get whether the set of particles changed since last evaluation 00061 virtual bool get_contained_particles_changed() const=0; 00062 //! Get contained particles 00063 /** Get a list of all particles contained in this one, 00064 given that the input containers are up to date. 00065 */ 00066 virtual ParticlesTemp get_contained_particles() const=0; 00067 00068 IMP_REF_COUNTED_DESTRUCTOR(Container); 00069 }; 00070 00071 IMP_END_NAMESPACE 00072 00073 #endif /* IMP_CONTAINER_BASE_H */