Salome HOME
Merge V8_4_BR branch.
[modules/kernel.git] / src / SALOMESDS / SALOMEWrappedStdType.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 # Author : Anthony Geay (EDF R&D)
21
22
23 import abc
24
25 def _raiseNow(strCont):
26     raise Exception("The method %s has been called whereas it is an interface !"%strCont)
27
28 class WrappedType(object):
29     """ Here definition of an interface in python."""
30     __metaclass__=abc.ABCMeta
31     @abc.abstractmethod
32     def ptr(self):
33         _raiseNow("ptr")
34     @abc.abstractmethod
35     def local_copy(self):
36         _raiseNow("local_copy")
37     @abc.abstractmethod
38     def assign(self,elt):
39         _raiseNow("assign")
40
41 class List(WrappedType):
42     @abc.abstractmethod
43     def __getitem__(self,*args):
44         _raiseNow("__getitem__")
45     @abc.abstractmethod
46     def __setitem__(self,*args):
47         _raiseNow("__setitem__")
48     @abc.abstractmethod
49     def __delitem__(self,*args):
50         _raiseNow("__delitem__")
51     @abc.abstractmethod
52     def append(self,*args):
53         _raiseNow("append")
54     @abc.abstractmethod
55     def extend(self,*args):
56         _raiseNow("extend")
57     @abc.abstractmethod
58     def insert(self,*args):
59         _raiseNow("insert")
60     @abc.abstractmethod
61     def pop(self,*args):
62         _raiseNow("pop")
63     @abc.abstractmethod
64     def remove(self,*args):
65         _raiseNow("remove")
66     @abc.abstractmethod
67     def reverse(self,*args):
68         _raiseNow("reverse")
69     @abc.abstractmethod
70     def sort(self,*args):
71         _raiseNow("sort")
72     # work on local copy
73     @abc.abstractmethod
74     def count(self,*args):
75         _raiseNow("count")
76     @abc.abstractmethod
77     def index(self,*args):
78         _raiseNow("index")
79     @abc.abstractmethod
80     def __len__(self):
81         _raiseNow("__len__")
82     pass
83
84 class Dict(WrappedType):
85     @abc.abstractmethod
86     def __getitem__(self,*args):
87         _raiseNow("__getitem__")
88     @abc.abstractmethod
89     def __setitem__(self,*args):
90         _raiseNow("__setitem__")
91     @abc.abstractmethod
92     def __delitem__(self,*args):
93         _raiseNow("__delitem__")
94     @abc.abstractmethod
95     def clear(self,*args):
96         _raiseNow("clear")
97     @abc.abstractmethod
98     def get(self,*args):
99         _raiseNow("get")
100     @abc.abstractmethod
101     def items(self,*args):
102         _raiseNow("items")
103     @abc.abstractmethod
104     def pop(self,*args):
105         _raiseNow("pop")
106     @abc.abstractmethod
107     def popitem(self,*args):
108         _raiseNow("popitem")
109     @abc.abstractmethod
110     def setdefault(self,*args):
111         _raiseNow("setdefault")
112     @abc.abstractmethod
113     def update(self,*args):
114         _raiseNow("update")
115     @abc.abstractmethod
116     def values(self,*args):
117         _raiseNow("values")
118     # work on local copy
119     @abc.abstractmethod
120     def __contains__(self,*args):
121         _raiseNow("__contains__")
122     @abc.abstractmethod
123     def has_key(self,*args):
124         _raiseNow("has_key")
125     @abc.abstractmethod
126     def keys(self,*args):
127         _raiseNow("keys")
128     @abc.abstractmethod
129     def copy(self,*args):
130         _raiseNow("copy")
131     @abc.abstractmethod
132     def __len__(self):
133         _raiseNow("__len__")
134     pass
135
136 class Tuple(WrappedType):
137     @abc.abstractmethod
138     def __getitem__(self,*args):
139         _raiseNow("__getitem__")
140     # work on local copy
141     @abc.abstractmethod
142     def count(self,*args):
143         _raiseNow("count")
144     @abc.abstractmethod
145     def index(self,*args):
146         _raiseNow("index")
147     @abc.abstractmethod
148     def __len__(self):
149         _raiseNow("__len__")
150     pass
151
152 class Float(WrappedType):
153     @abc.abstractmethod
154     def __iadd__(self,*args):
155         _raiseNow("__iadd__")
156     @abc.abstractmethod
157     def __isub__(self,*args):
158         _raiseNow("__isub__")
159     @abc.abstractmethod
160     def __imul__(self,*args):
161         _raiseNow("__imul__")
162     @abc.abstractmethod
163     def __idiv__(self,*args):
164         _raiseNow("__idiv__")
165     @abc.abstractmethod
166     def __add__(self,*args):
167         _raiseNow("__add__")
168     @abc.abstractmethod
169     def __sub__(self,*args):
170         _raiseNow("__sub__")
171     @abc.abstractmethod
172     def __mul__(self,*args):
173         _raiseNow("__mul__")
174     @abc.abstractmethod
175     def __div__(self,*args):
176         _raiseNow("__div__")
177     @abc.abstractmethod
178     def __pow__(self,*args):
179         _raiseNow("__pow__")
180     @abc.abstractmethod
181     def as_integer_ratio(self,*args):
182         _raiseNow("as_integer_ratio")
183     @abc.abstractmethod
184     def conjugate(self,*args):
185         _raiseNow("conjugate")
186     @abc.abstractmethod
187     def fromhex(self,*args):
188         _raiseNow("fromhex")
189     @abc.abstractmethod
190     def hex(self,*args):
191         _raiseNow("hex")
192     @abc.abstractmethod
193     def imag(self,*args):
194         _raiseNow("imag")
195     @abc.abstractmethod
196     def is_integer(self,*args):
197         _raiseNow("is_integer")
198     @abc.abstractmethod
199     def real(self,*args):
200         _raiseNow("real")
201     pass
202
203 class Int(WrappedType):
204     @abc.abstractmethod
205     def __iadd__(self,*args):
206         _raiseNow("__iadd__")
207     @abc.abstractmethod
208     def __isub__(self,*args):
209         _raiseNow("__isub__")
210     @abc.abstractmethod
211     def __imul__(self,*args):
212         _raiseNow("__imul__")
213     @abc.abstractmethod
214     def __imod__(self,*args):
215         _raiseNow("__imod__")
216     @abc.abstractmethod
217     def __idiv__(self,*args):
218         _raiseNow("__idiv__")
219     @abc.abstractmethod
220     def __add__(self,*args):
221         _raiseNow("__add__")
222     @abc.abstractmethod
223     def __sub__(self,*args):
224         _raiseNow("__sub__")
225     @abc.abstractmethod
226     def __mul__(self,*args):
227         _raiseNow("__mul__")
228     @abc.abstractmethod
229     def __mod__(self,*args):
230         _raiseNow("__mod__")
231     @abc.abstractmethod
232     def __div__(self,*args):
233         _raiseNow("__div__")
234     @abc.abstractmethod
235     def __pow__(self,*args):
236         _raiseNow("__pow__")
237     @abc.abstractmethod
238     def bit_length(self,*args):
239         _raiseNow("bit_length")
240     @abc.abstractmethod
241     def conjugate(self,*args):
242         _raiseNow("conjugate")
243     @abc.abstractmethod
244     def denominator(self,*args):
245         _raiseNow("denominator")
246     @abc.abstractmethod
247     def imag(self,*args):
248         _raiseNow("imag")
249     @abc.abstractmethod
250     def numerator(self,*args):
251         _raiseNow("numerator")
252     @abc.abstractmethod
253     def real(self,*args):
254         _raiseNow("real")
255     pass
256
257 class String(WrappedType):
258     @abc.abstractmethod
259     def __add__(self,*args):
260         _raiseNow("__add__")
261     @abc.abstractmethod
262     def __iadd__(self,*args):
263         _raiseNow("__iadd__")
264     @abc.abstractmethod
265     def __getitem__(self,*args):
266         _raiseNow("__getitem__")
267     @abc.abstractmethod
268     def capitalize(self,*args):
269         _raiseNow("capitalize")
270     @abc.abstractmethod
271     def center(self,*args):
272         _raiseNow("center")
273     @abc.abstractmethod
274     def count(self,*args):
275         _raiseNow("count")
276     @abc.abstractmethod
277     def decode(self,*args):
278         _raiseNow("decode")
279     @abc.abstractmethod
280     def encode(self,*args):
281         _raiseNow("encode")
282     @abc.abstractmethod
283     def endswith(self,*args):
284         _raiseNow("endswith")
285     @abc.abstractmethod
286     def expandtabs(self,*args):
287         _raiseNow("expandtabs")
288     @abc.abstractmethod
289     def find(self,*args):
290         _raiseNow("find")
291     @abc.abstractmethod
292     def format(self,*args):
293         _raiseNow("format")
294     @abc.abstractmethod
295     def index(self,*args):
296         _raiseNow("index")
297     @abc.abstractmethod
298     def isalnum(self,*args):
299         _raiseNow("isalnum")
300     @abc.abstractmethod
301     def isalpha(self,*args):
302         _raiseNow("isalpha")
303     @abc.abstractmethod
304     def isdigit(self,*args):
305         _raiseNow("isdigit")
306     @abc.abstractmethod
307     def islower(self,*args):
308         _raiseNow("islower")
309     @abc.abstractmethod
310     def isspace(self,*args):
311         _raiseNow("isspace")
312     @abc.abstractmethod
313     def istitle(self,*args):
314         _raiseNow("istitle")
315     @abc.abstractmethod
316     def isupper(self,*args):
317         _raiseNow("isupper")
318     @abc.abstractmethod
319     def join(self,*args):
320         _raiseNow("join")
321     @abc.abstractmethod
322     def ljust(self,*args):
323         _raiseNow("ljust")
324     @abc.abstractmethod
325     def lower(self,*args):
326         _raiseNow("lower")
327     @abc.abstractmethod
328     def lstrip(self,*args):
329         _raiseNow("lstrip")
330     @abc.abstractmethod
331     def partition(self,*args):
332         _raiseNow("partition")
333     @abc.abstractmethod
334     def replace(self,*args):
335         _raiseNow("replace")
336     @abc.abstractmethod
337     def rfind(self,*args):
338         _raiseNow("rfind")
339     @abc.abstractmethod
340     def rindex(self,*args):
341         _raiseNow("rindex")
342     @abc.abstractmethod
343     def rjust(self,*args):
344         _raiseNow("rjust")
345     @abc.abstractmethod
346     def rpartition(self,*args):
347         _raiseNow("rpartition")
348     @abc.abstractmethod
349     def rsplit(self,*args):
350         _raiseNow("rsplit")
351     @abc.abstractmethod
352     def rstrip(self,*args):
353         _raiseNow("rstrip")
354     @abc.abstractmethod
355     def split(self,*args):
356         _raiseNow("split")
357     @abc.abstractmethod
358     def splitlines(self,*args):
359         _raiseNow("splitlines")
360     @abc.abstractmethod
361     def startswith(self,*args):
362         _raiseNow("startswith")
363     @abc.abstractmethod
364     def strip(self,*args):
365         _raiseNow("strip")
366     @abc.abstractmethod
367     def swapcase(self,*args):
368         _raiseNow("swapcase")
369     @abc.abstractmethod
370     def title(self,*args):
371         _raiseNow("title")
372     @abc.abstractmethod
373     def translate(self,*args):
374         _raiseNow("translate")
375     @abc.abstractmethod
376     def upper(self,*args):
377         _raiseNow("upper")
378     @abc.abstractmethod
379     def zfill(self,*args):
380         _raiseNow("zfill")
381     @abc.abstractmethod
382     def __len__(self):
383         _raiseNow("__len__")
384     pass