LogCabin
Storage/LogFactory.h
Go to the documentation of this file.
00001 /* Copyright (c) 2014 Stanford University
00002  *
00003  * Permission to use, copy, modify, and distribute this software for any
00004  * purpose with or without fee is hereby granted, provided that the above
00005  * copyright notice and this permission notice appear in all copies.
00006  *
00007  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES
00008  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00009  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS BE LIABLE FOR
00010  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00011  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00012  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00013  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00014  */
00015 
00016 #include <memory>
00017 
00018 #ifndef LOGCABIN_STORAGE_LOGFACTORY_H
00019 #define LOGCABIN_STORAGE_LOGFACTORY_H
00020 
00021 namespace LogCabin {
00022 
00023 // forward declaration
00024 namespace Core {
00025 class Config;
00026 }
00027 
00028 
00029 namespace Storage {
00030 
00031 // forward declarations
00032 class Log;
00033 class Layout;
00034 
00035 namespace LogFactory {
00036 
00037 /**
00038  * Construct and return a Log object.
00039  * \param config
00040  *      Determines which concrete type of Log to construct.
00041  *      EXITs if this is invalid.
00042  * \param storageLayout
00043  *      Log implementations that write to the filesystem should place their
00044  *      files in here.
00045  * \return
00046  *      The newly constructed Log instance.
00047  */
00048 std::unique_ptr<Log>
00049 makeLog(const Core::Config& config,
00050         const Storage::Layout& storageLayout);
00051 
00052 } // namespace LogCabin::Storage::LogFactory
00053 } // namespace LogCabin::Storage
00054 } // namespace LogCabin
00055 
00056 #endif /* LOGCABIN_STORAGE_LOGFACTORY_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines