1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 using System;
29 using System.Diagnostics;
30 using uno;
31 using uno.util;
32 using unoidl.com.sun.star.uno;
33 using unoidl.com.sun.star.lang;
34 using unoidl.com.sun.star.test.performance;
35 
36 namespace testobj
37 {
38 
39 [ServiceImplementation( "com.sun.star.test.performance.cli_uno.TestObject" )]
40 public class PerformanceTestObject : ServiceBase, XPerformanceTest
41 {
42     private XComponentContext m_xContext;
43 
44     public PerformanceTestObject( XComponentContext xContext )
45     {
46         m_xContext = xContext;
47     }
48     public PerformanceTestObject()
49     {
50     }
51 
52     private int      _long;
53     private long     _hyper;
54     private float    _float;
55     private double   _double;
56     private String   _string = "";
57     private Object   _xInterface;
58     private Any   _any;
59     private Object[]   _interface_sequence = new Object[0];
60     private ComplexTypes _complexTypes = new ComplexTypes();
61 
62     // Attributes
63     public int getLong_attr() { return _long; }
64     public void setLong_attr( int _long_attr ) { _long = _long_attr; }
65     public long getHyper_attr() { return _hyper; }
66     public void setHyper_attr( long _hyper_attr ) { _hyper = _hyper_attr; }
67     public float getFloat_attr() { return _float; }
68     public void setFloat_attr( float _float_attr ) { _float = _float; }
69     public double getDouble_attr() { return _double; }
70     public void setDouble_attr( double _double_attr ) { _double = _double_attr; }
71     public String getString_attr() { return _string; }
72     public void setString_attr( String _string_attr ) { _string = _string_attr; }
73     public Object getInterface_attr() { return _xInterface; }
74     public void setInterface_attr( Object _interface_attr ) { _xInterface = _interface_attr; }
75     public Any getAny_attr() { return _any; }
76     public void setAny_attr( ref Any _any_attr ) { _any = _any_attr; }
77     public Object[] getSequence_attr() { return _interface_sequence; }
78     public void setSequence_attr(Object[] _sequence_attr ) { _interface_sequence = _sequence_attr; }
79     public ComplexTypes getStruct_attr() { return _complexTypes; }
80     public void setStruct_attr( ComplexTypes _struct_attr ) { _complexTypes = _struct_attr; }
81 
82     // Methods
83     public void async() {}
84     public void sync(  ) {}
85     public ComplexTypes complex_in( /*IN*/ComplexTypes aVal ) { return aVal; }
86     public ComplexTypes complex_inout( /*INOUT*/ref ComplexTypes aVal ) { return aVal; }
87     public void complex_oneway( /*IN*/ComplexTypes aVal ) {}
88     public void complex_noreturn( /*IN*/ComplexTypes aVal ) {}
89     public XPerformanceTest createObject(  ) { return new PerformanceTestObject(); }
90     public int getLong() { return _long; }
91     public void setLong(/*IN*/int n) { _long = n; }
92     public long getHyper() { return _hyper; }
93     public void setHyper(/*IN*/long n) { _hyper = n; }
94     public float getFloat() { return _float; }
95     public void setFloat( /*IN*/float f ) { _float = f; }
96     public double getDouble(  ) { return _double; }
97     public void setDouble( /*IN*/double f ) { _double = f; }
98     public String getString(  ) { return _string; }
99     public void setString( /*IN*/String s ) { _string = s; }
100     public Object getInterface(  ) { return _xInterface; }
101     public void setInterface( /*IN*/Object x ) { _xInterface = x; }
102     public Any getAny(  ) { return _any; }
103     public void setAny( /*IN*/ref Any a ) { _any = a; }
104     public Object[] getSequence(  ) { return _interface_sequence; }
105     public void setSequence( /*IN*/Object[] seq )
106     {
107 #if DEBUG
108 //         Debug.WriteLine( "#### " + GetType().FullName + ".setSequence:" + seq );
109         Console.WriteLine( "#### " + GetType().FullName + ".setSequence:" + seq );
110 #endif
111         _interface_sequence = seq;
112     }
113     public ComplexTypes getStruct(  ) { return _complexTypes; }
114     public void setStruct( /*IN*/ComplexTypes c ) { _complexTypes = c; }
115     public void raiseRuntimeException(  ) { throw new RuntimeException(); }
116 }
117 
118 }
119