/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: include/sgx/core/threading/staticthreadfarm.hpp

*/

#ifndef SGX_CORE_THREADING_STATICTHREADFARM_HPP
#define SGX_CORE_THREADING_STATICTHREADFARM_HPP	1

/**
This assigned each object to the next available thread, according to
the number of objects already in its list.

If one object takes long to process than other, the objects are not moved
between threads.
*/
class CStaticFarm {
public:
	CStaticFarm(CSGXProcessThread **pThreadList, int numThreads);
	CStaticFarm(sgxVector<CSGXProcessThread *>ThreadList);
	void addThread(CSGXProcessThread *pThread);

	CThread *assignObject(sgxObject *pObject, tUINT32 iWeight=1);
	void		assignObject(sgxObject **pObject, int numObjects);

protected:
	sgxVector<CSGXProcessThread *> m_ThreadList;
};

#endif /* SGX_CORE_THREADING_STATICTHREADFARM_HPP */
