GreenCloud Simulator
Main Page
Classes
Files
File List
File Members
greencloud
provideroutagent.h
Go to the documentation of this file.
1
/*
2
* provideroutagent.h
3
*
4
* @date Nov 12, 2013
5
* @author Guzek:Mateusz
6
*/
7
8
#ifndef PROVIDEROUTAGENT_H_
9
#define PROVIDEROUTAGENT_H_
10
#include <tcpapp.h>
11
#include "agent.h"
12
#include "tcp.h"
13
#include <stdlib.h>
14
#include <iostream>
15
16
/*Buffered list based on the CBuf from TcpApp*/
17
class
PoaBuf
{
18
public
:
19
PoaBuf
(
void
*c,
int
nbytes);
20
~PoaBuf
() {
21
}
22
void
*
pointer
() {
return
pointer_
; }
23
int
bytes
() {
return
nbytes_
; }
24
25
26
protected
:
27
friend
class
PoaBufList
;
28
void
*
pointer_
;
29
int
nbytes_
;
30
PoaBuf
*
next_
;
31
32
};
33
34
// A FIFO queue
35
class
PoaBufList
{
36
public
:
37
38
PoaBufList
() : head_(NULL), tail_(NULL) {}
39
~
PoaBufList
();
40
41
void
insert(
PoaBuf
*poabuf);
42
PoaBuf
* detach();
43
44
protected
:
45
PoaBuf
*
head_
;
46
PoaBuf
*
tail_
;
47
48
};
49
50
class
ProviderOutAgent
:
public
TcpAgent {
51
public
:
52
ProviderOutAgent
();
53
virtual
~
ProviderOutAgent
();
54
int
updateAgentDataBytes();
55
double
updateTime();
56
void
sendmsg(
int
nbytes,
void
*
pointer
);
57
void
tryToSend();
58
protected
:
59
int
lastTrackedBytes_
;
60
double
lastTrackedTime_
;
61
PoaBufList
poabuf_
;
62
};
63
64
#endif
/* PROVIDEROUTAGENT_H_ */
PoaBuf::pointer
void * pointer()
Definition:
provideroutagent.h:22
PoaBuf::nbytes_
int nbytes_
Definition:
provideroutagent.h:29
ProviderOutAgent
Definition:
provideroutagent.h:50
PoaBufList::tail_
PoaBuf * tail_
Definition:
provideroutagent.h:46
PoaBufList::PoaBufList
PoaBufList()
Definition:
provideroutagent.h:38
PoaBuf
Definition:
provideroutagent.h:17
PoaBuf::pointer_
void * pointer_
Definition:
provideroutagent.h:28
ProviderOutAgent::lastTrackedTime_
double lastTrackedTime_
Definition:
provideroutagent.h:60
PoaBufList::head_
PoaBuf * head_
Definition:
provideroutagent.h:45
ProviderOutAgent::lastTrackedBytes_
int lastTrackedBytes_
Definition:
provideroutagent.h:59
PoaBuf::~PoaBuf
~PoaBuf()
Definition:
provideroutagent.h:20
PoaBufList
Definition:
provideroutagent.h:35
PoaBuf::next_
PoaBuf * next_
Definition:
provideroutagent.h:30
ProviderOutAgent::poabuf_
PoaBufList poabuf_
Definition:
provideroutagent.h:61
PoaBuf::PoaBuf
PoaBuf(void *c, int nbytes)
Definition:
provideroutagent.cc:63
PoaBuf::bytes
int bytes()
Definition:
provideroutagent.h:23
Generated on Sat Jan 30 2016 10:58:35 for GreenCloud Simulator by
1.8.11