+// Copyright (C) 2006-2024 CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
#ifndef __TYPECODE_HXX__
#define __TYPECODE_HXX__
+#include "YACSlibEngineExport.hxx"
#include "RefCounter.hxx"
#include "Exception.hxx"
#include "Any.hxx"
* \see TypeCodeStruct
* \see TypeCodeArray
*/
- class TypeCode : public RefCounter
+ class YACSLIBENGINE_EXPORT TypeCode : public RefCounter
{
public:
TypeCode(DynType kind);
DynType kind() const;
const char * getKindRepr() const;
-
+ const TypeCode *subContentType(int lev) const;
virtual TypeCode *clone() const;
virtual void putReprAtPlace(char *pt, const char *val, bool deepCpy) const;
virtual void destroyZippedAny(char *data) const;
virtual AnyPtr getOrBuildAnyFromZippedData(char *data) const;
- virtual const char * name() const throw(Exception);
+ virtual const char * name() const;
virtual const char * shortName() const;
- virtual const char * id() const throw(Exception);
- virtual const TypeCode * contentType() const throw(Exception);
- virtual int isA(const char* repositoryId) const throw(Exception);
+ virtual const char * id() const;
+ virtual const TypeCode * contentType() const;
+ virtual int isA(const char* repositoryId) const;
virtual int isA(const TypeCode* tc) const ;
virtual int isAdaptable(const TypeCode* tc) const;
virtual int isEquivalent(const TypeCode* tc) const;
virtual unsigned getSizeInByteOfAnyReprInSeq() const;
+ virtual std::string getPrintStr() const;
static const char *getKindRepr(DynType kind);
static TypeCode * interfaceTc(const char* id, const char* name);
// --- These operators are placed here to avoid them being used externally
TypeCode(const TypeCode& tc);
TypeCode& operator=(const TypeCode& tc);
+#ifndef SWIG
virtual ~TypeCode();
+#endif
protected:
const DynType _kind;
static const char *KIND_STR_REPR [];
};
- class TypeCodeComposed : public TypeCode
+ class YACSLIBENGINE_EXPORT TypeCodeComposed : public TypeCode
{
protected:
TypeCodeComposed(const TypeCodeComposed& other);
* \ingroup TypeCodes
*
*/
- class TypeCodeObjref : public TypeCodeComposed
+ class YACSLIBENGINE_EXPORT TypeCodeObjref : public TypeCodeComposed
{
friend class Visitor;
public:
void putReprAtPlace(char *pt, const char *val, bool deepCpy) const;
void destroyZippedAny(char *data) const;
AnyPtr getOrBuildAnyFromZippedData(char *data) const;
- const char * id() const throw(Exception);
- const char * name() const throw(Exception);
+ const char * id() const;
+ const char * name() const;
const char * shortName() const;
- int isA(const char* repositoryId) const throw(Exception);
+ int isA(const char* repositoryId) const;
virtual int isA(const TypeCode* tc) const ;
virtual int isAdaptable(const TypeCode* tc) const;
virtual int isEquivalent(const TypeCode* tc) const;
protected:
- ~TypeCodeObjref();
+#ifndef SWIG
+ virtual ~TypeCodeObjref();
+#endif
TypeCodeObjref(const TypeCodeObjref& other);
private:
std::list<TypeCodeObjref *> _listOfBases;
* \ingroup TypeCodes
*
*/
- class TypeCodeSeq: public TypeCodeComposed
+ class YACSLIBENGINE_EXPORT TypeCodeSeq: public TypeCodeComposed
{
public:
TypeCodeSeq(const char* repositoryId, const char* name, const TypeCode *content);
void destroyZippedAny(char *data) const;
virtual unsigned getSizeInByteOfAnyReprInSeq() const;
AnyPtr getOrBuildAnyFromZippedData(char *data) const;
- const char * id() const throw(Exception);
- const char * name() const throw(Exception);
+ const char * id() const;
+ const char * name() const;
const char * shortName() const;
+ virtual std::string getPrintStr() const;
- virtual const TypeCode * contentType() const throw(Exception);
+ virtual const TypeCode * contentType() const;
virtual int isA(const TypeCode* tc) const ;
virtual int isAdaptable(const TypeCode* tc) const;
virtual int isEquivalent(const TypeCode* tc) const;
protected:
- ~TypeCodeSeq();
+#ifndef SWIG
+ virtual ~TypeCodeSeq();
+#endif
TypeCodeSeq(const TypeCodeSeq& tc);
private:
const TypeCode *_content;
* \ingroup TypeCodes
*
*/
- class TypeCodeArray : public TypeCodeComposed
+ class YACSLIBENGINE_EXPORT TypeCodeArray : public TypeCodeComposed
{
public:
TypeCodeArray(const char* repositoryId, const char* name, const TypeCode *content, unsigned staticLgth);
void putReprAtPlace(char *pt, const char *val, bool deepCpy) const;
void destroyZippedAny(char *data) const;
AnyPtr getOrBuildAnyFromZippedData(char *data) const;
- const char * id() const throw(Exception);
- const char * name() const throw(Exception);
+ const char * id() const;
+ const char * name() const;
const char * shortName() const;
unsigned getStaticLgth() const;
- virtual const TypeCode * contentType() const throw(Exception);
+ virtual const TypeCode * contentType() const;
virtual int isA(const TypeCode* tc) const ;
virtual int isAdaptable(const TypeCode* tc) const;
virtual int isEquivalent(const TypeCode* tc) const;
unsigned getSizeInByteOfAnyReprInSeq() const;
protected:
- ~TypeCodeArray();
+#ifndef SWIG
+ virtual ~TypeCodeArray();
+#endif
TypeCodeArray(const TypeCodeArray& tc);
private:
const TypeCode *_content;
* \ingroup TypeCodes
*
*/
- class TypeCodeStruct : public TypeCodeComposed
+ class YACSLIBENGINE_EXPORT TypeCodeStruct : public TypeCodeComposed
{
friend class StructAny;//Access to _members attribute.
public:
void putReprAtPlace(char *pt, const char *val, bool deepCpy) const;
void destroyZippedAny(char *data) const;
AnyPtr getOrBuildAnyFromZippedData(char *data) const;
- const char * id() const throw(Exception);
- const char * name() const throw(Exception);
+ const char * id() const;
+ const char * name() const;
const char * shortName() const;
virtual unsigned getSizeInByteOfAnyReprInSeq() const;
- const TypeCode * contentType() const throw(Exception);
- virtual int isA(const char* repositoryId) const throw(Exception);
+ const TypeCode * contentType() const;
+ virtual int isA(const char* repositoryId) const;
virtual int isA(const TypeCode* tc) const ;
virtual int isAdaptable(const TypeCode* tc) const;
virtual int isEquivalent(const TypeCode* tc) const;
const char* memberName(int index) const;
TypeCode* memberType(int index) const;
protected:
- ~TypeCodeStruct();
+#ifndef SWIG
+ virtual ~TypeCodeStruct();
+#endif
TypeCodeStruct(const TypeCodeStruct& tc);
private:
std::vector< std::pair<std::string,TypeCode*> > _members;