Mercurial > projects > orange
comparison orange/util/Traits.d @ 39:301476d40518
Made a couple of refactorings:
* Removed Serializable
* Added a Serializable interface
* Moved isSerializable and updated the implementation
* Added new deserialize methods for deserialize without data during deserializing
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Thu, 04 Aug 2011 21:29:56 +0200 |
parents | fc315d786f24 |
children |
comparison
equal
deleted
inserted
replaced
38:9443bcddc699 | 39:301476d40518 |
---|---|
195 is(typeof({TypeOfDataType!(T) a = T.data;})) && | 195 is(typeof({TypeOfDataType!(T) a = T.data;})) && |
196 is(typeof(T.unarchiveAssociativeArrayVisitor!(int[string]))); | 196 is(typeof(T.unarchiveAssociativeArrayVisitor!(int[string]))); |
197 | 197 |
198 } | 198 } |
199 | 199 |
200 template isSerializable (T, SerializerType) | |
201 { | |
202 const isSerializable = is(typeof(T.toData(SerializerType.init, SerializerType.DataType.init))) && is(typeof(T.fromData(SerializerType.init, SerializerType.DataType.init))); | |
203 } | |
204 | |
205 template isISerializable (T) | |
206 { | |
207 const isISerializable = is(T : ISerializable); | |
208 } | |
209 | |
210 template TypeOfDataType (T) | 200 template TypeOfDataType (T) |
211 { | 201 { |
212 alias T.DataType TypeOfDataType; | 202 alias T.DataType TypeOfDataType; |
213 } | 203 } |