1 // Created on: 1994-08-26
2 // Created by: Gilles DEBARBOUILLE
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 // CRD : 15/04/97 : Passage WOK++ : Remplacement de TYPE par STANDARD_TYPE
19 #include <Dynamic_CompositMethod.ixx>
22 //=======================================================================
23 //function : Dynamic_CompositMethod
25 //=======================================================================
27 Dynamic_CompositMethod::Dynamic_CompositMethod(const Standard_CString aname)
28 : Dynamic_MethodDefinition(aname)
30 thesequenceofmethods = new Dynamic_SequenceOfMethods();
33 //=======================================================================
36 //=======================================================================
38 void Dynamic_CompositMethod::Method(const Handle(Dynamic_Method)& amethod)
40 if(amethod->IsKind(STANDARD_TYPE(Dynamic_MethodDefinition)))
41 cout<<"bad argument type"<<endl;
43 thesequenceofmethods->Append(amethod);
46 //=======================================================================
47 //function : NumberOfMethods
49 //=======================================================================
51 Standard_Integer Dynamic_CompositMethod::NumberOfMethods() const
53 return thesequenceofmethods->Length();
56 //=======================================================================
59 //=======================================================================
61 Handle(Dynamic_Method) Dynamic_CompositMethod::Method(const Standard_Integer anindex) const
63 return thesequenceofmethods->Value(anindex);
66 //=======================================================================
69 //=======================================================================
71 void Dynamic_CompositMethod::Dump(Standard_OStream& astream) const
73 astream << "CompositMethod : " << endl;
74 Dynamic_MethodDefinition::Dump(astream);
75 astream << "Dump of Methods Instances : " << endl;
76 for (Standard_Integer i=1; i<= thesequenceofmethods->Length(); i++) {
77 astream << "Method No : " << i << endl;
78 thesequenceofmethods->Value(i)->Dump(astream);