Design Pattern Examples
Overview of object-oriented design patterns
Adapter_BackEnd.h
Go to the documentation of this file.
1
7
8#pragma once
9#ifndef __ADAPTER_BACKENDFUNCTIONS_H__
10#define __ADAPTER_BACKENDFUNCTIONS_H__
11
12#include <stdint.h>
13
14#ifdef _MSC_VER
15#ifdef ADAPTERBACKEND_EXPORTS
16#define DllExport __declspec(dllexport)
17#else
18#define DllExport __declspec(dllimport)
19#endif
20#else
21#define DllExport
22#endif
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
29 DllExport extern const char* BLOCK_NAME_0;
30
32 DllExport extern const char* BLOCK_NAME_1;
33
35 DllExport extern const char* BLOCK_NAME_2;
36
37
38 enum {
40
42 };
43
48 typedef enum
49 {
58
59
70 DllExport DDR_ErrorCode DDR_OpenMemoryBlock(const char* blockName, int* dataHandle);
71
81
92 DllExport DDR_ErrorCode DDR_GetMemorySize(int dataHandle, int *memorySizeInChunks);
93
105 DllExport DDR_ErrorCode DDR_GetDataChunk(int dataHandle, int chunkOffset, uint32_t *value);
106
118 DllExport DDR_ErrorCode DDR_SetDataChunk(int dataHandle, int chunkOffset, uint32_t value);
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif // __ADAPTER_BACKENDFUNCTIONS_H__
DllExport DDR_ErrorCode DDR_GetDataChunk(int dataHandle, int chunkOffset, uint32_t *value)
Read a single 32-bit value at the given offset in the memory block indicated by the specified handle.
DllExport DDR_ErrorCode DDR_GetMemorySize(int dataHandle, int *memorySizeInChunks)
Retrieve the number of chunks in the memory block indicated by the handle to the successfully opened ...
DDR_ErrorCode
Represents the possible errors that can be returned from the memory block access functions.
@ DDR_ErrorCode_Block_Not_Opened
Memory block is closed and cannot be accessed.
@ DDR_ErrorCode_Block_Already_Opened
Memory block is already open and cannot be opened again.
@ DDR_ErrorCode_Null_Argument
The block name pointer or return handle pointer argument is NULL.
@ DDR_ErrorCode_Invalid_Block_Name
The given name is not a recognized memory block name.
@ DDR_ErrorCode_Invalid_Handle
The handle argument does not correspond to a valid open memory block.
@ DDR_ErrorCode_Success
Operation succeeded.
@ DDR_ErrorCode_Invalid_Offset
The given offset is out of bounds.
DllExport DDR_ErrorCode DDR_CloseMemoryBlock(int dataHandle)
Close access to a previously opened memory block, thus releasing it for others to open.
DllExport DDR_ErrorCode DDR_OpenMemoryBlock(const char *blockName, int *dataHandle)
Open access to a memory block for exclusive use, given the name of the memory block.
DllExport const char * BLOCK_NAME_2
Name of the third block.
DllExport const char * BLOCK_NAME_1
Name of the second block.
DllExport const char * BLOCK_NAME_0
Name of the first block.
@ DDR_MAX_OFFSET
All offsets must from 0 to 1 less than this value.
@ DDR_INVALID_HANDLE
Value indicating the handle is invalid.
DllExport DDR_ErrorCode DDR_SetDataChunk(int dataHandle, int chunkOffset, uint32_t value)
Writes a single 32-bit value to the given offset in the memory block indicated by the specified handl...
#define DllExport