WPILibC++
unspecified
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
InstanceImpl.h
1
/*----------------------------------------------------------------------------*/
2
/* Copyright (c) 2016-2018 FIRST. 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 NTCORE_INSTANCEIMPL_H_
9
#define NTCORE_INSTANCEIMPL_H_
10
11
#include <atomic>
12
#include <memory>
13
14
#include <wpi/UidVector.h>
15
#include <wpi/mutex.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
wpi::mutex s_mutex;
56
};
57
58
}
// namespace nt
59
60
#endif // NTCORE_INSTANCEIMPL_H_
nt::Dispatcher
Definition:
Dispatcher.h:130
nt::DsClient
Definition:
DsClient.h:19
nt::InstanceImpl
Definition:
InstanceImpl.h:28
nt::Storage
Definition:
Storage.h:45
nt::EntryNotifier
Definition:
EntryNotifier.h:75
nt
Definition:
IStorage.h:21
nt::LoggerImpl
Definition:
LoggerImpl.h:58
wpi::UidVector
Definition:
UidVector.h:23
nt::ConnectionNotifier
Definition:
ConnectionNotifier.h:46
wpi::Logger
Definition:
Logger.h:30
nt::RpcServer
Definition:
RpcServer.h:83
build
cppSource
ntcore-cpp
sources
InstanceImpl.h
Generated on Sun Jul 1 2018 15:46:15 for WPILibC++ by
1.8.11