|
1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: base class of Alf data types |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include "glxvarianttypebase.h" |
|
22 |
|
23 #include <alf/alfdataexception.h> // Exception class used with invalid data exceptions |
|
24 #include <glxlog.h> // Logging |
|
25 |
|
26 using namespace Alf; |
|
27 using namespace osncore; |
|
28 |
|
29 // ---------------------------------------------------------------------------- |
|
30 // set |
|
31 // ---------------------------------------------------------------------------- |
|
32 // |
|
33 void IGlxVariantTypeBase::set( IAlfVariantType& /*aValue*/ ) |
|
34 { |
|
35 // this interface is not possible to implement |
|
36 } |
|
37 |
|
38 // ---------------------------------------------------------------------------- |
|
39 // expected to be overridden by base class if a valid type |
|
40 // ---------------------------------------------------------------------------- |
|
41 // |
|
42 bool IGlxVariantTypeBase::boolean() const |
|
43 { |
|
44 TRACER("IGlxVariantTypeBase::boolean"); |
|
45 ALF_THROW( AlfDataException, EInvalidVariantDataType, "GlxVariantTypeBase" ); |
|
46 } |
|
47 |
|
48 // ---------------------------------------------------------------------------- |
|
49 // expected to be overridden by base class if a valid type |
|
50 // ---------------------------------------------------------------------------- |
|
51 // |
|
52 int IGlxVariantTypeBase::integer() const |
|
53 { |
|
54 TRACER("IGlxVariantTypeBase::integer"); |
|
55 ALF_THROW( AlfDataException, EInvalidVariantDataType, "GlxVariantTypeBase" ); |
|
56 } |
|
57 |
|
58 // ---------------------------------------------------------------------------- |
|
59 // expected to be overridden by base class if a valid type |
|
60 // ---------------------------------------------------------------------------- |
|
61 // |
|
62 uint IGlxVariantTypeBase::uinteger() const |
|
63 { |
|
64 TRACER("IGlxVariantTypeBase::uinteger"); |
|
65 ALF_THROW( AlfDataException, EInvalidVariantDataType, "GlxVariantTypeBase" ); |
|
66 } |
|
67 |
|
68 // ---------------------------------------------------------------------------- |
|
69 // expected to be overridden by base class if a valid type |
|
70 // ---------------------------------------------------------------------------- |
|
71 // |
|
72 double IGlxVariantTypeBase::real() const |
|
73 { |
|
74 TRACER("IGlxVariantTypeBase::real"); |
|
75 ALF_THROW( AlfDataException, EInvalidVariantDataType, "GlxVariantTypeBase" ); |
|
76 } |
|
77 |
|
78 // ---------------------------------------------------------------------------- |
|
79 // expected to be overridden by base class if a valid type |
|
80 // ---------------------------------------------------------------------------- |
|
81 // |
|
82 const UString& IGlxVariantTypeBase::string() const |
|
83 { |
|
84 TRACER("IGlxVariantTypeBase::string"); |
|
85 ALF_THROW( AlfDataException, EInvalidVariantDataType, "GlxVariantTypeBase" ); |
|
86 } |
|
87 |
|
88 // ---------------------------------------------------------------------------- |
|
89 // expected to be overridden by base class if a valid type |
|
90 // ---------------------------------------------------------------------------- |
|
91 // |
|
92 IAlfContainer* IGlxVariantTypeBase::container() |
|
93 { |
|
94 TRACER("IGlxVariantTypeBase::container"); |
|
95 ALF_THROW( AlfDataException, EInvalidVariantDataType, "GlxVariantTypeBase" ); |
|
96 } |
|
97 |
|
98 // ---------------------------------------------------------------------------- |
|
99 // expected to be overridden by base class if a valid type |
|
100 // ---------------------------------------------------------------------------- |
|
101 // |
|
102 IAlfMap* IGlxVariantTypeBase::map() |
|
103 { |
|
104 TRACER("IGlxVariantTypeBase::map"); |
|
105 ALF_THROW( AlfDataException, EInvalidVariantDataType, "GlxVariantTypeBase" ); |
|
106 } |
|
107 |
|
108 // ---------------------------------------------------------------------------- |
|
109 // expected to be overridden by base class if a valid type |
|
110 // ---------------------------------------------------------------------------- |
|
111 // |
|
112 IAlfBranch* IGlxVariantTypeBase::branch() |
|
113 { |
|
114 TRACER("IGlxVariantTypeBase::branch"); |
|
115 ALF_THROW( AlfDataException, EInvalidVariantDataType, "GlxVariantTypeBase" ); |
|
116 } |
|
117 |
|
118 // ---------------------------------------------------------------------------- |
|
119 // expected to be overridden by base class if a valid type |
|
120 // ---------------------------------------------------------------------------- |
|
121 // |
|
122 IAlfModelBase* IGlxVariantTypeBase::customData() |
|
123 { |
|
124 TRACER("IGlxVariantTypeBase::customData"); |
|
125 ALF_THROW( AlfDataException, EInvalidVariantDataType, "GlxVariantTypeBase" ); |
|
126 } |
|
127 |
|
128 // ---------------------------------------------------------------------------- |
|
129 // type |
|
130 // ---------------------------------------------------------------------------- |
|
131 // |
|
132 IAlfVariantType::Type IGlxStringVariantTypeBase::type() const |
|
133 { |
|
134 TRACER("IGlxStringVariantTypeBase::type"); |
|
135 return EString; |
|
136 } |
|
137 |
|
138 // ---------------------------------------------------------------------------- |
|
139 // type |
|
140 // ---------------------------------------------------------------------------- |
|
141 // |
|
142 IAlfVariantType::Type IGlxIntVariantTypeBase::type() const |
|
143 { |
|
144 TRACER("IGlxIntVariantTypeBase::type"); |
|
145 return EInt; |
|
146 } |