Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
contentStoreInterface.h
1 /*
2  * Copyright (c) 2017-2019 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef contentStoreInterface_h
17 #define contentStoreInterface_h
18 
19 #include <stdio.h>
20 
21 #include <hicn/core/message.h>
22 
23 typedef struct contentstore_config {
24  size_t objectCapacity;
26 
28 
40  bool (*putContent)(ContentStoreInterface *storeImpl, Message *content,
41  uint64_t currentTimeTicks);
42 
51  bool (*removeContent)(ContentStoreInterface *storeImpl, Message *content);
52 
64  Message *(*matchInterest)(ContentStoreInterface *storeImpl, Message *interest,
65  uint64_t currentTimeTicks);
66 
76 
84  size_t (*getObjectCount)(ContentStoreInterface *storeImpl);
85 
92  void (*log)(ContentStoreInterface *storeImpl);
93 
101  ContentStoreInterface *(*acquire)(const ContentStoreInterface *storeImpl);
102 
109  void (*release)(ContentStoreInterface **storeImpl);
110 
116 };
117 
129 bool contentStoreInterface_PutContent(ContentStoreInterface *storeImpl,
130  Message *content,
131  uint64_t currentTimeTicks);
132 
141 bool contentStoreInterface_RemoveContent(ContentStoreInterface *storeImpl,
142  Message *content);
143 
155 Message *contentStoreInterface_MatchInterest(ContentStoreInterface *storeImpl,
156  Message *interest,
157  uint64_t currentTimeTicks);
158 
167 size_t contentStoreInterface_GetObjectCapacity(
168  ContentStoreInterface *storeImpl);
169 
177 size_t contentStoreInterface_GetObjectCount(ContentStoreInterface *storeImpl);
178 
185 void contentStoreInterface_Log(ContentStoreInterface *storeImpl);
186 
194 ContentStoreInterface *contentStoreInterface_Aquire(
195  const ContentStoreInterface *storeImpl);
196 
202 void contentStoreInterface_Release(ContentStoreInterface **storeImplPtr);
203 
210 void *contentStoreInterface_GetPrivateData(ContentStoreInterface *storeImpl);
211 #endif // contentStoreInterface_h
contentstore_interface::release
void(* release)(ContentStoreInterface **storeImpl)
Definition: contentStoreInterface.h:109
contentstore_interface::log
void(* log)(ContentStoreInterface *storeImpl)
Definition: contentStoreInterface.h:92
contentstore_interface::_privateData
void * _privateData
Definition: contentStoreInterface.h:115
contentstore_interface
Definition: contentStoreInterface.h:29
contentstore_interface::removeContent
bool(* removeContent)(ContentStoreInterface *storeImpl, Message *content)
Definition: contentStoreInterface.h:51
contentstore_interface::getObjectCount
size_t(* getObjectCount)(ContentStoreInterface *storeImpl)
Definition: contentStoreInterface.h:84
message.h
Message is the unit of forwarding, i.e. the packets being switched.
contentstore_interface::putContent
bool(* putContent)(ContentStoreInterface *storeImpl, Message *content, uint64_t currentTimeTicks)
Definition: contentStoreInterface.h:40
contentstore_config
Definition: contentStoreInterface.h:23
contentstore_interface::getObjectCapacity
size_t(* getObjectCapacity)(ContentStoreInterface *storeImpl)
Definition: contentStoreInterface.h:75