added max-age and content-format

Fork of mbedConnectorInterface by Doug Anson

Committer:
michaeljkoster
Date:
Tue Apr 14 04:00:01 2015 +0000
Revision:
52:822611156e35
Parent:
24:a6915e19814e
added interfaces for max-age and content-format

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 0:b438482ebbfc 1 /**
ansond 0:b438482ebbfc 2 * @file StaticResource.h
ansond 0:b438482ebbfc 3 * @brief mbed CoAP Endpoint Static Resource class
ansond 0:b438482ebbfc 4 * @author Doug Anson/Chris Paola
ansond 0:b438482ebbfc 5 * @version 1.0
sam_grove 2:853f9ecc12df 6 * @see
ansond 0:b438482ebbfc 7 *
ansond 0:b438482ebbfc 8 * Copyright (c) 2014
ansond 0:b438482ebbfc 9 *
ansond 0:b438482ebbfc 10 * Licensed under the Apache License, Version 2.0 (the "License");
ansond 0:b438482ebbfc 11 * you may not use this file except in compliance with the License.
ansond 0:b438482ebbfc 12 * You may obtain a copy of the License at
ansond 0:b438482ebbfc 13 *
ansond 0:b438482ebbfc 14 * http://www.apache.org/licenses/LICENSE-2.0
ansond 0:b438482ebbfc 15 *
ansond 0:b438482ebbfc 16 * Unless required by applicable law or agreed to in writing, software
ansond 0:b438482ebbfc 17 * distributed under the License is distributed on an "AS IS" BASIS,
ansond 0:b438482ebbfc 18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ansond 0:b438482ebbfc 19 * See the License for the specific language governing permissions and
ansond 0:b438482ebbfc 20 * limitations under the License.
ansond 0:b438482ebbfc 21 */
sam_grove 2:853f9ecc12df 22
sam_grove 2:853f9ecc12df 23 #ifndef __STATIC_RESOURCE_H__
sam_grove 2:853f9ecc12df 24 #define __STATIC_RESOURCE_H__
sam_grove 2:853f9ecc12df 25
sam_grove 2:853f9ecc12df 26 // Base Class
sam_grove 2:853f9ecc12df 27 #include "Resource.h"
sam_grove 2:853f9ecc12df 28
sam_grove 2:853f9ecc12df 29 // String class support
sam_grove 2:853f9ecc12df 30 #include <string>
sam_grove 2:853f9ecc12df 31
ansond 24:a6915e19814e 32 // DataWrapper support
ansond 24:a6915e19814e 33 #include "DataWrapper.h"
ansond 24:a6915e19814e 34
sam_grove 2:853f9ecc12df 35 /** StaticResource is a static (GET only) resource with a value type pinned as a string type
sam_grove 2:853f9ecc12df 36 */
sam_grove 2:853f9ecc12df 37 class StaticResource : public Resource<string>
sam_grove 2:853f9ecc12df 38 {
sam_grove 2:853f9ecc12df 39 public:
sam_grove 2:853f9ecc12df 40 /**
sam_grove 2:853f9ecc12df 41 Default constructor
sam_grove 2:853f9ecc12df 42 @param logger input logger instance for this resource
sam_grove 2:853f9ecc12df 43 @param name input the Resource URI/Name
sam_grove 2:853f9ecc12df 44 @param value input the Resource value (a string)
sam_grove 2:853f9ecc12df 45 */
sam_grove 2:853f9ecc12df 46 StaticResource(const Logger *logger,const char *name,const char *value);
sam_grove 2:853f9ecc12df 47
sam_grove 2:853f9ecc12df 48 /**
sam_grove 2:853f9ecc12df 49 string value constructor
sam_grove 2:853f9ecc12df 50 @param logger input logger instance for this resource
sam_grove 2:853f9ecc12df 51 @param name input the Resource URI/Name
sam_grove 2:853f9ecc12df 52 @param value input the Resource value (a string)
sam_grove 2:853f9ecc12df 53 */
sam_grove 2:853f9ecc12df 54 StaticResource(const Logger *logger,const char *name,const string value);
ansond 0:b438482ebbfc 55
sam_grove 2:853f9ecc12df 56 /**
sam_grove 2:853f9ecc12df 57 constructor with buffer lengths
sam_grove 2:853f9ecc12df 58 @param logger input logger instance for this resource
sam_grove 2:853f9ecc12df 59 @param name input the Resource URI/Name
sam_grove 2:853f9ecc12df 60 #param name_length input the length of the Resource URI/Name
sam_grove 2:853f9ecc12df 61 @param value input the Resource value (or NULL)
sam_grove 2:853f9ecc12df 62 */
sam_grove 2:853f9ecc12df 63 StaticResource(const Logger *logger,const string name,const string value);
sam_grove 2:853f9ecc12df 64
sam_grove 2:853f9ecc12df 65 /**
sam_grove 2:853f9ecc12df 66 Copy constructor
sam_grove 2:853f9ecc12df 67 @param resource input the StaticResource that is to be deep copied
sam_grove 2:853f9ecc12df 68 */
sam_grove 2:853f9ecc12df 69 StaticResource(const StaticResource &resource);
sam_grove 2:853f9ecc12df 70
sam_grove 2:853f9ecc12df 71 /**
sam_grove 2:853f9ecc12df 72 Destructor
sam_grove 2:853f9ecc12df 73 */
sam_grove 2:853f9ecc12df 74 virtual ~StaticResource();
sam_grove 2:853f9ecc12df 75
sam_grove 2:853f9ecc12df 76 /**
sam_grove 2:853f9ecc12df 77 Bind resource to endpoint
sam_grove 2:853f9ecc12df 78 @param p input pointer to the endpoint resources necessary for binding
sam_grove 2:853f9ecc12df 79 */
sam_grove 2:853f9ecc12df 80 virtual void bind(void *p);
ansond 24:a6915e19814e 81
ansond 24:a6915e19814e 82 /**
ansond 24:a6915e19814e 83 Set the data wrapper
ansond 24:a6915e19814e 84 @param data_wrapper input the data wrapper instance
ansond 24:a6915e19814e 85 */
ansond 24:a6915e19814e 86 void setDataWrapper(DataWrapper *data_wrapper) { this->m_data_wrapper = data_wrapper; }
sam_grove 2:853f9ecc12df 87
sam_grove 2:853f9ecc12df 88 protected:
ansond 24:a6915e19814e 89 DataWrapper *getDataWrapper() { return this->m_data_wrapper; }
sam_grove 2:853f9ecc12df 90
sam_grove 2:853f9ecc12df 91 private:
ansond 24:a6915e19814e 92 DataWrapper *m_data_wrapper;
sam_grove 2:853f9ecc12df 93 };
sam_grove 2:853f9ecc12df 94
sam_grove 2:853f9ecc12df 95 #endif // __STATIC_RESOURCE_H__