xref: /AOO41X/main/testtools/source/performance/cli_testobj_performance.cs (revision b5da552ccefc4034e06a43bfae43fb8a8b64a7ad)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 using System;
25 using System.Diagnostics;
26 using uno;
27 using uno.util;
28 using unoidl.com.sun.star.uno;
29 using unoidl.com.sun.star.lang;
30 using unoidl.com.sun.star.test.performance;
31 
32 namespace testobj
33 {
34 
35 [ServiceImplementation( "com.sun.star.test.performance.cli_uno.TestObject" )]
36 public class PerformanceTestObject : ServiceBase, XPerformanceTest
37 {
38     private XComponentContext m_xContext;
39 
40     public PerformanceTestObject( XComponentContext xContext )
41     {
42         m_xContext = xContext;
43     }
44     public PerformanceTestObject()
45     {
46     }
47 
48     private int      _long;
49     private long     _hyper;
50     private float    _float;
51     private double   _double;
52     private String   _string = "";
53     private Object   _xInterface;
54     private Any   _any;
55     private Object[]   _interface_sequence = new Object[0];
56     private ComplexTypes _complexTypes = new ComplexTypes();
57 
58     // Attributes
59     public int getLong_attr() { return _long; }
60     public void setLong_attr( int _long_attr ) { _long = _long_attr; }
61     public long getHyper_attr() { return _hyper; }
62     public void setHyper_attr( long _hyper_attr ) { _hyper = _hyper_attr; }
63     public float getFloat_attr() { return _float; }
64     public void setFloat_attr( float _float_attr ) { _float = _float; }
65     public double getDouble_attr() { return _double; }
66     public void setDouble_attr( double _double_attr ) { _double = _double_attr; }
67     public String getString_attr() { return _string; }
68     public void setString_attr( String _string_attr ) { _string = _string_attr; }
69     public Object getInterface_attr() { return _xInterface; }
70     public void setInterface_attr( Object _interface_attr ) { _xInterface = _interface_attr; }
71     public Any getAny_attr() { return _any; }
72     public void setAny_attr( ref Any _any_attr ) { _any = _any_attr; }
73     public Object[] getSequence_attr() { return _interface_sequence; }
74     public void setSequence_attr(Object[] _sequence_attr ) { _interface_sequence = _sequence_attr; }
75     public ComplexTypes getStruct_attr() { return _complexTypes; }
76     public void setStruct_attr( ComplexTypes _struct_attr ) { _complexTypes = _struct_attr; }
77 
78     // Methods
79     public void async() {}
80     public void sync(  ) {}
81     public ComplexTypes complex_in( /*IN*/ComplexTypes aVal ) { return aVal; }
82     public ComplexTypes complex_inout( /*INOUT*/ref ComplexTypes aVal ) { return aVal; }
83     public void complex_oneway( /*IN*/ComplexTypes aVal ) {}
84     public void complex_noreturn( /*IN*/ComplexTypes aVal ) {}
85     public XPerformanceTest createObject(  ) { return new PerformanceTestObject(); }
86     public int getLong() { return _long; }
87     public void setLong(/*IN*/int n) { _long = n; }
88     public long getHyper() { return _hyper; }
89     public void setHyper(/*IN*/long n) { _hyper = n; }
90     public float getFloat() { return _float; }
91     public void setFloat( /*IN*/float f ) { _float = f; }
92     public double getDouble(  ) { return _double; }
93     public void setDouble( /*IN*/double f ) { _double = f; }
94     public String getString(  ) { return _string; }
95     public void setString( /*IN*/String s ) { _string = s; }
96     public Object getInterface(  ) { return _xInterface; }
97     public void setInterface( /*IN*/Object x ) { _xInterface = x; }
98     public Any getAny(  ) { return _any; }
99     public void setAny( /*IN*/ref Any a ) { _any = a; }
100     public Object[] getSequence(  ) { return _interface_sequence; }
101     public void setSequence( /*IN*/Object[] seq )
102     {
103 #if DEBUG
104 //         Debug.WriteLine( "#### " + GetType().FullName + ".setSequence:" + seq );
105         Console.WriteLine( "#### " + GetType().FullName + ".setSequence:" + seq );
106 #endif
107         _interface_sequence = seq;
108     }
109     public ComplexTypes getStruct(  ) { return _complexTypes; }
110     public void setStruct( /*IN*/ComplexTypes c ) { _complexTypes = c; }
111     public void raiseRuntimeException(  ) { throw new RuntimeException(); }
112 }
113 
114 }
115