Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027 C12832 EthernetInterface StatusReporter LM75B MQTT-ansond endpoint_core endpoint_mqtt mbed-rtos mbed
EmulatedResourceFactory.h@41:36c59c3cd6f2, 2014-03-01 (annotated)
- Committer:
- ansond
- Date:
- Sat Mar 01 07:43:17 2014 +0000
- Revision:
- 41:36c59c3cd6f2
- Parent:
- 39:bd5b2bcd2dcc
- Child:
- 42:46cc1641800b
updates
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ansond | 0:ae2a45502448 | 1 | /* Copyright C2013 Doug Anson, MIT License |
| ansond | 0:ae2a45502448 | 2 | * |
| ansond | 0:ae2a45502448 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
| ansond | 0:ae2a45502448 | 4 | * and associated documentation files the "Software", to deal in the Software without restriction, |
| ansond | 0:ae2a45502448 | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
| ansond | 0:ae2a45502448 | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
| ansond | 0:ae2a45502448 | 7 | * furnished to do so, subject to the following conditions: |
| ansond | 0:ae2a45502448 | 8 | * |
| ansond | 0:ae2a45502448 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
| ansond | 0:ae2a45502448 | 10 | * substantial portions of the Software. |
| ansond | 0:ae2a45502448 | 11 | * |
| ansond | 0:ae2a45502448 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
| ansond | 0:ae2a45502448 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| ansond | 0:ae2a45502448 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| ansond | 0:ae2a45502448 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| ansond | 0:ae2a45502448 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| ansond | 0:ae2a45502448 | 17 | */ |
| ansond | 0:ae2a45502448 | 18 | |
| ansond | 0:ae2a45502448 | 19 | #ifndef _EMULATED_RESOURCE_FACTORY_H_ |
| ansond | 0:ae2a45502448 | 20 | #define _EMULATED_RESOURCE_FACTORY_H_ |
| ansond | 0:ae2a45502448 | 21 | |
| ansond | 0:ae2a45502448 | 22 | // Base Class |
| ansond | 0:ae2a45502448 | 23 | #include "ResourceFactory.h" |
| ansond | 0:ae2a45502448 | 24 | |
| ansond | 8:45f9a920e82c | 25 | // Emulated callback structure |
| ansond | 8:45f9a920e82c | 26 | typedef void (*EmulatedCallbackPointer)(); |
| ansond | 8:45f9a920e82c | 27 | |
| ansond | 0:ae2a45502448 | 28 | // ErrorHandler support |
| ansond | 0:ae2a45502448 | 29 | #include "ErrorHandler.h" |
| ansond | 0:ae2a45502448 | 30 | |
| ansond | 39:bd5b2bcd2dcc | 31 | // Resource Initializer callback structure |
| ansond | 39:bd5b2bcd2dcc | 32 | typedef void (*resourceInitializer)(Resource *); |
| ansond | 39:bd5b2bcd2dcc | 33 | |
| ansond | 0:ae2a45502448 | 34 | class EmulatedResourceFactory : public ResourceFactory { |
| ansond | 0:ae2a45502448 | 35 | public: |
| ansond | 39:bd5b2bcd2dcc | 36 | EmulatedResourceFactory(ErrorHandler *error_handler,void *endpoint); |
| ansond | 0:ae2a45502448 | 37 | virtual ~EmulatedResourceFactory(); |
| ansond | 0:ae2a45502448 | 38 | |
| ansond | 0:ae2a45502448 | 39 | virtual void createResources(char *endpoint_name); |
| ansond | 8:45f9a920e82c | 40 | |
| ansond | 39:bd5b2bcd2dcc | 41 | bool setResourceValue3(char *name, char *value); |
| ansond | 39:bd5b2bcd2dcc | 42 | |
| ansond | 39:bd5b2bcd2dcc | 43 | protected: |
| ansond | 39:bd5b2bcd2dcc | 44 | virtual void createResource(char *name,char *value); |
| ansond | 39:bd5b2bcd2dcc | 45 | virtual void createResource(char *endpoint_name,char *name,char *value,void *cb); |
| ansond | 41:36c59c3cd6f2 | 46 | void createResource(char *name,char *value,void *io,void *notused); |
| ansond | 39:bd5b2bcd2dcc | 47 | }; |
| ansond | 0:ae2a45502448 | 48 | |
| ansond | 0:ae2a45502448 | 49 | |
| ansond | 0:ae2a45502448 | 50 | #endif // _EMULATED_RESOURCE_FACTORY_H_ |