From fda97f6eead19c976ab839e342437d7214d9dc38 Mon Sep 17 00:00:00 2001 From: Julien Malik <julien.malik@c-s.fr> Date: Sat, 5 Nov 2011 17:16:14 +0100 Subject: [PATCH] ENH: [SWIG] don't wrap private and protected section --- Code/Wrappers/SWIG/PyCommand.i | 1 - Code/Wrappers/SWIG/Python.i | 4 --- Code/Wrappers/SWIG/itkBase.i | 47 ++--------------------------- Code/Wrappers/SWIG/otbApplication.i | 35 +++++++++------------ 4 files changed, 17 insertions(+), 70 deletions(-) diff --git a/Code/Wrappers/SWIG/PyCommand.i b/Code/Wrappers/SWIG/PyCommand.i index 1cc2abfa82..744c3d4972 100644 --- a/Code/Wrappers/SWIG/PyCommand.i +++ b/Code/Wrappers/SWIG/PyCommand.i @@ -33,7 +33,6 @@ public: void SetCommandCallable(PyObject *obj); PyObject * GetCommandCallable(); void Execute(itkObject *, const itkEventObject&); - //void Execute(const itkObject *, const EventObject&); protected: itkPyCommand(); ~itkPyCommand(); diff --git a/Code/Wrappers/SWIG/Python.i b/Code/Wrappers/SWIG/Python.i index 87c27f91e4..728b6c270b 100644 --- a/Code/Wrappers/SWIG/Python.i +++ b/Code/Wrappers/SWIG/Python.i @@ -59,10 +59,6 @@ class_name##_Pointer & operator=(class_name##_Pointer const & r); class_name##_Pointer & operator=(class_name## * r); // class_name * Print(std::ostream & os) const; - private: - void Register(); - void UnRegister(); - protected: }; // pointers and references diff --git a/Code/Wrappers/SWIG/itkBase.i b/Code/Wrappers/SWIG/itkBase.i index bc45111058..df8f819d35 100644 --- a/Code/Wrappers/SWIG/itkBase.i +++ b/Code/Wrappers/SWIG/itkBase.i @@ -47,16 +47,11 @@ class itkIndent { public: - ~itkIndent(); - itkIndent & operator=(itkIndent const & arg0); - itkIndent(itkIndent const & arg0); static itkIndent * New(); void Delete(); itkIndent(int ind = 0); static char const * GetNameOfClass(); itkIndent GetNextIndent(); - private: - protected: }; class itkLightObject { @@ -71,15 +66,9 @@ class itkIndent { virtual void UnRegister() const; virtual int GetReferenceCount() const; virtual void SetReferenceCount(int arg0); - private: - itkLightObject(itkLightObject const & arg0); - void operator=(itkLightObject const & arg0); protected: itkLightObject(); //~itkLightObject(); - virtual void PrintSelf(std::ostream & os, itkIndent indent) const; - virtual void PrintHeader(std::ostream & os, itkIndent indent) const; - virtual void PrintTrailer(std::ostream & os, itkIndent indent) const; }; DECLARE_REF_COUNT_CLASS( itkLightObject ) @@ -112,14 +101,9 @@ class itkIndent { itkMetaDataDictionary & GetMetaDataDictionary(); itkMetaDataDictionary const & GetMetaDataDictionary() const; void SetMetaDataDictionary(itkMetaDataDictionary const & rhs); - private: - itkObject(itkObject const & arg0); - void operator=(itkObject const & arg0); protected: itkObject(); //~itkObject(); - virtual void PrintSelf(std::ostream & os, itkIndent indent) const; - bool PrintObservers(std::ostream & os, itkIndent indent) const; }; DECLARE_REF_COUNT_CLASS( itkObject ) @@ -129,9 +113,9 @@ class itkIndent { //static itkProcessObject_Pointer New(); virtual itkLightObject_Pointer CreateAnother() const; const float& GetProgress(); - private: - itkProcessObject(itkProcessObject const & arg0); - void operator=(itkProcessObject const & arg0); + protected: + itkProcessObject(); + //~itkProcessObject(); }; DECLARE_REF_COUNT_CLASS( itkProcessObject ) @@ -156,18 +140,7 @@ class itkIndent { virtual bool GetEnableFlag(char const * className, char const * subclassName); virtual void Disable(char const * className); char const * GetLibraryPath(); - private: - itkObjectFactoryBase(itkObjectFactoryBase const & arg0); - void operator=(itkObjectFactoryBase const & arg0); - static void Initialize(); - static void RegisterDefaults(); - static void LoadDynamicFactories(); - static void LoadLibrariesInPath(char const * arg0); protected: - virtual void PrintSelf(std::ostream & os, itkIndent indent) const; - void RegisterOverride(char const * classOverride, char const * overrideClassName, char const * description, bool enableFlag, itk::CreateObjectFunctionBase * createFunction); - virtual itkLightObject_Pointer CreateObject(char const * itkclassname); - virtual std::list< itkLightObject_Pointer > CreateAllObject(char const * itkclassname); itkObjectFactoryBase(); //~itkObjectFactoryBase(); }; @@ -185,8 +158,6 @@ class itkIndent { itkMetaDataObjectBase_Pointer & operator[](std::string const & arg0); itkMetaDataObjectBase const * operator[](std::string const & arg0) const; bool HasKey(std::string const & arg0) const; - private: - protected: }; @@ -196,9 +167,6 @@ class itkIndent { virtual char const * GetNameOfClass() const; virtual void Execute(itkObject * caller, itkEventObject const & event) = 0; // virtual void Execute(itkObject const * caller, itkEventObject const & event) = 0; - private: - itkCommand(itkCommand const & arg0); - void operator=(itkCommand const & arg0); protected: itkCommand(); //~itkCommand(); @@ -216,12 +184,6 @@ class itkIndent { virtual void Print(std::ostream & os) const; virtual char const * GetEventName() const = 0; virtual bool CheckEvent(itkEventObject const * arg0) const = 0; - private: - void operator=(itkEventObject const & arg0); - protected: - virtual void PrintSelf(std::ostream & os, itkIndent indent) const; - virtual void PrintHeader(std::ostream & os, itkIndent indent) const; - virtual void PrintTrailer(std::ostream & os, itkIndent indent) const; }; %define DECLARE_itkEventObject_CLASS(class_name, superclass_name) @@ -234,9 +196,6 @@ class itkIndent { virtual bool CheckEvent(itkEventObject const * e) const; virtual itkEventObject * MakeObject() const; class_name(class_name const & s); - private: - void operator=(class_name const & arg0); - protected: }; %enddef diff --git a/Code/Wrappers/SWIG/otbApplication.i b/Code/Wrappers/SWIG/otbApplication.i index 8fee5b1395..f45bd0ded8 100644 --- a/Code/Wrappers/SWIG/otbApplication.i +++ b/Code/Wrappers/SWIG/otbApplication.i @@ -195,30 +195,23 @@ public: protected: Registry(); virtual ~Registry(); - -private: - Registry(const Self&); - void operator=(const Self&); }; -class AddProcessToWatchEvent : public itkEventObject { - public: - AddProcessToWatchEvent(); - ~AddProcessToWatchEvent(); - virtual char const * GetEventName() const; - virtual bool CheckEvent(itkEventObject const * e) const; - virtual itkEventObject * MakeObject() const; - AddProcessToWatchEvent(AddProcessToWatchEvent const & s); - - itkProcessObject * GetProcess() const; - void SetProcess(itkProcessObject * process); - void SetProcessDescription(const std::string desc); - std::string GetProcessDescription() const; - - private: - void operator=(AddProcessToWatchEvent const & arg0); - protected: +class AddProcessToWatchEvent : public itkEventObject +{ +public: + AddProcessToWatchEvent(); + ~AddProcessToWatchEvent(); + virtual char const * GetEventName() const; + virtual bool CheckEvent(itkEventObject const * e) const; + virtual itkEventObject * MakeObject() const; + AddProcessToWatchEvent(AddProcessToWatchEvent const & s); + + itkProcessObject * GetProcess() const; + void SetProcess(itkProcessObject * process); + void SetProcessDescription(const std::string desc); + std::string GetProcessDescription() const; }; %include "PyCommand.i" -- GitLab