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 
PerformanceTestObject( XComponentContext xContext )40     public PerformanceTestObject( XComponentContext xContext )
41     {
42         m_xContext = xContext;
43     }
PerformanceTestObject()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
getLong_attr()59     public int getLong_attr() { return _long; }
setLong_attr( int _long_attr )60     public void setLong_attr( int _long_attr ) { _long = _long_attr; }
getHyper_attr()61     public long getHyper_attr() { return _hyper; }
setHyper_attr( long _hyper_attr )62     public void setHyper_attr( long _hyper_attr ) { _hyper = _hyper_attr; }
getFloat_attr()63     public float getFloat_attr() { return _float; }
setFloat_attr( float _float_attr )64     public void setFloat_attr( float _float_attr ) { _float = _float; }
getDouble_attr()65     public double getDouble_attr() { return _double; }
setDouble_attr( double _double_attr )66     public void setDouble_attr( double _double_attr ) { _double = _double_attr; }
getString_attr()67     public String getString_attr() { return _string; }
setString_attr( String _string_attr )68     public void setString_attr( String _string_attr ) { _string = _string_attr; }
getInterface_attr()69     public Object getInterface_attr() { return _xInterface; }
setInterface_attr( Object _interface_attr )70     public void setInterface_attr( Object _interface_attr ) { _xInterface = _interface_attr; }
getAny_attr()71     public Any getAny_attr() { return _any; }
setAny_attr( ref Any _any_attr )72     public void setAny_attr( ref Any _any_attr ) { _any = _any_attr; }
getSequence_attr()73     public Object[] getSequence_attr() { return _interface_sequence; }
setSequence_attr(Object[] _sequence_attr )74     public void setSequence_attr(Object[] _sequence_attr ) { _interface_sequence = _sequence_attr; }
getStruct_attr()75     public ComplexTypes getStruct_attr() { return _complexTypes; }
setStruct_attr( ComplexTypes _struct_attr )76     public void setStruct_attr( ComplexTypes _struct_attr ) { _complexTypes = _struct_attr; }
77 
78     // Methods
async()79     public void async() {}
sync( )80     public void sync(  ) {}
complex_in( ComplexTypes aVal )81     public ComplexTypes complex_in( /*IN*/ComplexTypes aVal ) { return aVal; }
complex_inout( ref ComplexTypes aVal )82     public ComplexTypes complex_inout( /*INOUT*/ref ComplexTypes aVal ) { return aVal; }
complex_oneway( ComplexTypes aVal )83     public void complex_oneway( /*IN*/ComplexTypes aVal ) {}
complex_noreturn( ComplexTypes aVal )84     public void complex_noreturn( /*IN*/ComplexTypes aVal ) {}
createObject( )85     public XPerformanceTest createObject(  ) { return new PerformanceTestObject(); }
getLong()86     public int getLong() { return _long; }
setLong( int n)87     public void setLong(/*IN*/int n) { _long = n; }
getHyper()88     public long getHyper() { return _hyper; }
setHyper( long n)89     public void setHyper(/*IN*/long n) { _hyper = n; }
getFloat()90     public float getFloat() { return _float; }
setFloat( float f )91     public void setFloat( /*IN*/float f ) { _float = f; }
getDouble( )92     public double getDouble(  ) { return _double; }
setDouble( double f )93     public void setDouble( /*IN*/double f ) { _double = f; }
getString( )94     public String getString(  ) { return _string; }
setString( String s )95     public void setString( /*IN*/String s ) { _string = s; }
getInterface( )96     public Object getInterface(  ) { return _xInterface; }
setInterface( Object x )97     public void setInterface( /*IN*/Object x ) { _xInterface = x; }
getAny( )98     public Any getAny(  ) { return _any; }
setAny( ref Any a )99     public void setAny( /*IN*/ref Any a ) { _any = a; }
getSequence( )100     public Object[] getSequence(  ) { return _interface_sequence; }
setSequence( Object[] seq )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     }
getStruct( )109     public ComplexTypes getStruct(  ) { return _complexTypes; }
setStruct( ComplexTypes c )110     public void setStruct( /*IN*/ComplexTypes c ) { _complexTypes = c; }
raiseRuntimeException( )111     public void raiseRuntimeException(  ) { throw new RuntimeException(); }
112 }
113 
114 }
115