MemoryFactory.h revision affc150dc44fab1911775a49636d0ce85333b634
1//===- MemoryFactory.h ----------------------------------------------------===//
2//
3//                     The MCLinker Project
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef ALONE_SUPPORT_MEMORY_FACTORY_H
11#define ALONE_SUPPORT_MEMORY_FACTORY_H
12
13#include <mcld/Support/FileHandle.h>
14#include <mcld/Support/MemoryAreaFactory.h>
15
16namespace mcld {
17class MemoryArea;
18} // end namespace mcld
19
20namespace alone {
21
22class MemoryFactory : public mcld::MemoryAreaFactory
23{
24public:
25  MemoryFactory();
26
27  ~MemoryFactory() { }
28
29  using mcld::MemoryAreaFactory::produce;
30
31  mcld::MemoryArea* produce(void *pMemBuffer, size_t pSize)
32  { return mcld::MemoryAreaFactory::create(pMemBuffer, pSize); }
33
34  mcld::MemoryArea* produce(int pFD)
35  { return mcld::MemoryAreaFactory::create(pFD, mcld::FileHandle::Unknown); }
36};
37
38} // end namespace alone
39
40#endif // ALONE_SUPPORT_MEMORY_FACTORY_H
41