WPILibC++
unspecified
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
InstanceImpl.h
1
/*----------------------------------------------------------------------------*/
2
/* Copyright (c) FIRST 2016-2017. All Rights Reserved. */
3
/* Open Source Software - may be modified and shared by FRC teams. The code */
4
/* must be accompanied by the FIRST BSD license file in the root directory of */
5
/* the project. */
6
/*----------------------------------------------------------------------------*/
7
8
#ifndef NT_INSTANCEIMPL_H_
9
#define NT_INSTANCEIMPL_H_
10
11
#include <atomic>
12
#include <memory>
13
#include <mutex>
14
15
#include "support/UidVector.h"
16
17
#include "ConnectionNotifier.h"
18
#include "Dispatcher.h"
19
#include "DsClient.h"
20
#include "EntryNotifier.h"
21
#include "Log.h"
22
#include "LoggerImpl.h"
23
#include "RpcServer.h"
24
#include "Storage.h"
25
26
namespace
nt
{
27
28
class
InstanceImpl
{
29
public
:
30
explicit
InstanceImpl
(
int
inst);
31
~
InstanceImpl
();
32
33
// Instance repository
34
static
InstanceImpl
* GetDefault();
35
static
InstanceImpl
* Get(
int
inst);
36
static
int
GetDefaultIndex();
37
static
int
Alloc();
38
static
void
Destroy(
int
inst);
39
40
LoggerImpl
logger_impl;
41
wpi::Logger
logger;
42
ConnectionNotifier
connection_notifier;
43
EntryNotifier
entry_notifier;
44
RpcServer
rpc_server;
45
Storage
storage;
46
Dispatcher
dispatcher;
47
DsClient
ds_client;
48
49
private
:
50
static
int
AllocImpl();
51
52
static
std::atomic<int> s_default;
53
static
std::atomic<InstanceImpl*> s_fast_instances[10];
54
static
wpi::UidVector<std::unique_ptr<InstanceImpl>
, 10> s_instances;
55
static
std::mutex s_mutex;
56
};
57
58
}
// namespace nt
59
60
#endif // NT_INSTANCEIMPL_H_
nt::Dispatcher
Definition:
Dispatcher.h:128
nt::DsClient
Definition:
DsClient.h:19
nt::InstanceImpl
Definition:
InstanceImpl.h:28
nt::Storage
Definition:
Storage.h:43
nt::EntryNotifier
Definition:
EntryNotifier.h:74
nt
Definition:
IEntryNotifier.h:15
nt::LoggerImpl
Definition:
LoggerImpl.h:59
wpi::UidVector
Definition:
UidVector.h:22
nt::ConnectionNotifier
Definition:
ConnectionNotifier.h:47
wpi::Logger
Definition:
Logger.h:30
nt::RpcServer
Definition:
RpcServer.h:80
build
cppSource
ntcore-cpp
sources
InstanceImpl.h
Generated on Sat Oct 28 2017 21:17:16 for WPILibC++ by
1.8.11