summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/resultbuffer.h
blob: 07cea4bc36c3ad7be0e25487d90454043e716206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. 
//

#include <stdio.h>
#include <iostream>
//#include <assert.h>
#ifndef _RESULT_BUFFER_H_
#define _RESULT_BUFFER_H_

//#include <palsuite.h>

struct ResultData
{
	int value;
	int size;
//	ResultData* NextResult;
};

 class ResultBuffer
{
		//  Declare a pointer to a memory buffer to store the logged results
		char* buffer;
		// Declare an object to store the maximum Thread count
		int	MaxThreadCount;
		// Declare and internal data object to store the calculated offset between adjacent threads data sets
		int	ThreadOffset;

		// Declare a linked list object to store the parameter values
public:

	// Declare a constructor for the single process case
	ResultBuffer(int ThreadCount, int ThreadLogSize);
	// Declare a method to log data for the single process instance
	int LogResult(int Thread, char* Data);

    char* getResultBuffer(int threadId);
};

#include "resultbuffer.cpp"
#endif // _RESULT_BUFFER_H_