Skip to content

Libs/Optimize/Container/GenericContainer.h

Namespaces

Name
shapeworks
User usage reporting (telemetry)

Classes

Name
class shapeworks::GenericContainer
This class seems to be only a wrapper around std::vector implementing ITK DataObject (for smart pointer?)

Source code

```cpp

pragma once

include

include "itkCommand.h"

include "itkDataObject.h"

include "itkWeakPointer.h"

namespace shapeworks { template class GenericContainer : public itk::DataObject { public: typedef T DataType; typedef GenericContainer Self; typedef DataObject Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef itk::WeakPointer ConstWeakPointer;

itkNewMacro(Self);

itkTypeMacro(GenericContainer, itk::DataObject);

inline T& operator { if (k >= data.size()) { data.resize(k + 1); } return data[k]; }

inline T& Get(size_t k) { return (*this)[k]; }

unsigned long int GetSize() const { return data.size(); }

protected: GenericContainer() {} void PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os, indent);

os << indent << "ParticleContainer: " << std::endl;

} virtual ~GenericContainer(){};

private: GenericContainer(const Self&); // purposely not implemented void operator=(const Self&); // purposely not implemented

std::vector data; };

} // end namespace shapeworks ```


Updated on 2026-03-31 at 16:02:11 +0000