Data store for arbitrary data types with type safe storage and retrieval
First Claim
1. In a computer system, a method, comprising:
- receiving requests from a compiler compiling source code, including requests to store elements of at least two different data types, and requests to retrieve at least some of the stored elements;
executing storage method code in response to a request to store an element having a data type and a key, the storage method code storing the element in a data store according to the key and in association with data type information; and
executing retrieval method code in response to a request to retrieve an element based on its key, the retrieval method code comparing the data type information associated with the requested element with data type information provided for the element in conjunction with the retrieval request, and if the type information matches, returning the element in response to the request, and if the type information does not match, generating an exception.
2 Assignments
0 Petitions
Accused Products
Abstract
A compile-time data store that contains arbitrary data types is accessed via methods that ensure type safety. A type construct (e.g., a C++ template) is instantiated at compile time and generates a data store that contains arbitrarily-typed data objects, such as integers, characters, pointers and so forth. The construct includes a Put method to put any element (object) of a listed type (e.g., of a typelist) in the data store, and a Get method to retrieve the element from the data store. The Put method maintains a type index in association with each stored in the data store. The Get method validates that the type of object that was requested in the call to the Get method matches the object type that was stored in the Put method. When run, the Get method returns the element data upon a type match, otherwise the Get method generates an exception.
-
Citations
20 Claims
-
1. In a computer system, a method, comprising:
-
receiving requests from a compiler compiling source code, including requests to store elements of at least two different data types, and requests to retrieve at least some of the stored elements; executing storage method code in response to a request to store an element having a data type and a key, the storage method code storing the element in a data store according to the key and in association with data type information; and executing retrieval method code in response to a request to retrieve an element based on its key, the retrieval method code comparing the data type information associated with the requested element with data type information provided for the element in conjunction with the retrieval request, and if the type information matches, returning the element in response to the request, and if the type information does not match, generating an exception. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. In a computing environment, a system comprising:
-
a compile-time construct that generates a data store in which arbitrary types of data elements are stored based on a key, the compile-time construct having mechanisms instantiated by a compiler to provide access to the data store, including a storage mechanism and a retrieval mechanism; the storage mechanism configured to store an element having a data type and a key, the storage mechanism storing the element in the data store according to the key and in association with data type information; and the retrieval mechanism configured to validate that a requested via its key and having a specified data type corresponds to the associated data type information of that element in the data store, and if so, to return data of the element in response to the request, and if not, to generate an exception. - View Dependent Claims (8, 9, 10, 11, 12, 13)
-
-
14. In a computing environment, a system comprising:
-
a compiler including means for compiling source code into compiled code; a compile-time construct means instantiated by the compiler, and for generating a data store to contain data of arbitrary types as stored elements referenced by keys; a storage means, the storage means receiving an element having a data type in a request to store the element as referenced by a key, the storage means storing the element in the data store referenced by the key and in association with data type information; and a retrieval means, the retrieval means operating in response to a request to return an element referenced by a key and having a specified data type, the retrieval means validating that the specified data type corresponds to the data type information associated with the element in the data store, and if so, the retrieval means returning data of the element in response to the request, and if not, the retrieval means generating an exception. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
Specification