GBStore Class Reference
| Inherits from | NSObject |
| Declared in | GBStore.h GBStore.m |
Overview
Implements the application's in-memory objects data store.
Store handles the storage of in-memory representations of parsed objects and enables a single entry point for later processing.
Tasks
Registrations handling
-
– registerClass:Registers the given class to the providers data. -
– registerCategory:Registers the given category to the providers data. -
– registerProtocol:Registers the given protocol to the providers data. -
– unregisterTopLevelObject:Unregisters the given class, category or protocol.
Data handling
-
– classWithName:Returns the class instance that matches the given name. -
– categoryWithName:Returns the category instance that matches the given name. -
– protocolWithName:Returns the protocol instance that matches the given name. -
classesThe list of all registered classes as instances ofGBClassData. property -
categoriesThe list of all registered categories and extensions as instances ofGBCategoryData. property -
protocolsThe list of all registered protocols as instances ofGBProtocolData. property
Helper methods
-
– classesSortedByNameReturns all registered classes sorted by their name. -
– categoriesSortedByNameReturns all registered categories sorted by their name. -
– protocolsSortedByNameReturns all registered protocols sorted by their name.
Properties
categories
The list of all registered categories and extensions as instances of GBCategoryData.
@property (readonly) NSSet *categoriesSee Also
Declared In
GBStore.hclasses
The list of all registered classes as instances of GBClassData.
@property (readonly) NSSet *classesSee Also
Declared In
GBStore.hInstance Methods
categoriesSortedByName
Returns all registered categories sorted by their name.
- (NSArray *)categoriesSortedByNameDeclared In
GBStore.hcategoryWithName:
Returns the category instance that matches the given name.
- (GBCategoryData *)categoryWithName:(NSString *)nameParameters
- name
- The name of the category to return.
Return Value
Returns category instance or nil if no match is found.
Discussion
If no registered category matches the given name, nil is returned.
Declared In
GBStore.hclassWithName:
Returns the class instance that matches the given name.
- (GBClassData *)classWithName:(NSString *)nameParameters
- name
- The name of the class to return.
Return Value
Returns class instance or nil if no match is found.
Discussion
If no registered class matches the given name, nil is returned.
Declared In
GBStore.hclassesSortedByName
Returns all registered classes sorted by their name.
- (NSArray *)classesSortedByNameDeclared In
GBStore.hprotocolWithName:
Returns the protocol instance that matches the given name.
- (GBProtocolData *)protocolWithName:(NSString *)nameParameters
- name
- The name of the protocol to return.
Return Value
Returns protocol instance or nil if no match is found.
Discussion
If no registered protocol matches the given name, nil is returned.
Declared In
GBStore.hprotocolsSortedByName
Returns all registered protocols sorted by their name.
- (NSArray *)protocolsSortedByNameDeclared In
GBStore.hregisterCategory:
Registers the given category to the providers data.
- (void)registerCategory:(GBCategoryData *)categoryParameters
- category
- The category to register.
Discussion
If provider doesn't yet have the given category instance registered, the object is added to categories list. If the same object is already registered, nothing happens.
Note: If another instance of the category with the same name/class name is registered, an exception is thrown.
Exceptions
- NSException
- Thrown if the given category is already registered.
See Also
Declared In
GBStore.hregisterClass:
Registers the given class to the providers data.
- (void)registerClass:(GBClassData *)classParameters
- class
- The class to register.
Discussion
If provider doesn't yet have the given class instance registered, the object is added to classes list. If the same object is already registered, nothing happens.
Note: If another instance of the class with the same name is registered, an exception is thrown.
Exceptions
- NSException
- Thrown if the given class is already registered.
See Also
Declared In
GBStore.hregisterProtocol:
Registers the given protocol to the providers data.
- (void)registerProtocol:(GBProtocolData *)protocolParameters
- protocol
- The protocol to register.
Discussion
If provider doesn't yet have the given protocol instance registered, the object is added to protocols list. If the same object is already registered, nothing happens.
Note: If another instance of the protocol with the same name name is registered, an exception is thrown.
Exceptions
- NSException
- Thrown if the given protocol is already registered.
See Also
Declared In
GBStore.h