[instance] define ot::Instance class (#2307)

This commit makes the following changes: It defines the public
`otInstance` as an empty opaque structure which is used by all public
C OpenThread APIs. It defines a new class `ot::Instance` (inheriting
from `otInstance) which is then used in core source files. The
functionality related to the instance is also moved/added into the
newly added `Instance` class (as class/static or member methods).
This commit is contained in:
Abtin Keshavarzian
2017-11-13 08:27:57 -08:00
committed by Jonathan Hui
parent a394155372
commit 02c876ef62
174 changed files with 1903 additions and 1137 deletions
+3 -3
View File
@@ -29,9 +29,9 @@
#include <stdarg.h>
#include <openthread/openthread.h>
#include <openthread-instance.h>
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "common/message.hpp"
#include "utils/wrap_string.h"
@@ -208,7 +208,7 @@ void VerifyMsgQueueContent(ot::MessageQueue &aMessageQueue, int aExpectedLength,
void TestPriorityQueue(void)
{
otInstance *instance;
ot::Instance *instance;
ot::MessagePool *messagePool;
ot::PriorityQueue queue;
ot::MessageQueue messageQueue;
@@ -221,7 +221,7 @@ void TestPriorityQueue(void)
instance = testInitInstance();
VerifyOrQuit(instance != NULL, "Null OpenThread instance\n");
messagePool = &instance->mMessagePool;
messagePool = &instance->GetMessagePool();
// Allocate messages with different priorities.
for (int i = 0; i < kNumTestMessages; i++)