summaryrefslogtreecommitdiff
path: root/TAO/examples/CSD_Strategy/ThreadPool2/FooServantList.h
blob: efab29f418727214316fe93a917a49cb1f300405 (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
#ifndef FOOSERVANTLIST_H
#define FOOSERVANTLIST_H

#include "tao/ORB.h"
#include "tao/PortableServer/PortableServer.h"
#include "tao/PortableServer/Servant_Base.h"
#include "ace/SString.h"


class FooServantList
{
public:
  FooServantList(const ACE_TCHAR* prefix,
                  unsigned num_servants,
                  unsigned num_clients,
                  CORBA::ORB_ptr orb);
  ~FooServantList();

  void create_and_activate(PortableServer::POA_ptr poa);

  void client_done(void);

private:
  PortableServer::ServantBase_var* servants_;
  ACE_TString prefix_;
  unsigned num_servants_;

  ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned> num_clients_;

  CORBA::ORB_var  orb_;
};

#endif