<commit_before>/************************************************************************************
**  
* @copyright (c) 2013-2100, ChengDu Duyer Technology Co., LTD. All Right Reserved.
*
*************************************************************************************/
/**
* @file     g_dfs_server.h
* @version     
* @brief      
* @author   duye
* @date     2014-09-24
* @note 
*
*  1. 2014-09-24 duye Created this file
* 
*/

#pragma once

#include <g_system.h>
#include <g_common.h>
#include <g_utils.h>

#include <g_dfs_http_server.h>
#include <g_dfs_ftp_server.h>
#include <g_dfs_cli_server.h>

static const std::string DEF_DFS_CFG_FILE_PATH("./dfs_cfg.xml");

namespace gdfs {

/**
 * @brief dfs server
 */
class DfsServer : public gcom::NetworkServer, public gcom::Singleton<DfsServer>
{
public:
    DfsServer();
    explicit DfsServer(const std::string& dfs_cfg_file_path);
    ~DfsServer();
    
    /**
     * @brief startup DFF service
     */
    GResult start();
    
    /**
     * @brief stop DFS service
     */
    GResult stop();
    
    /**
     * @brief set/get DFS service state
     */
    void setState(const DFSServerState state);
    const DFSServerState& getState() const;
    
private:
    // inherit from base class gsys::ThreadTask
    GResult run();
    // read DFS Server configuration file
    GResult loadCfg();
    // create service thread
    GResult createService();
    
private:
    std::string         m_dfsCfgFilePath;
    gcom::CfgMgr        m_cfgMgr;
    
    // dfs services list
    DfsHttpServer       m_httpServer;
    DfsFtpServer        m_ftpServer;
    DfsCliServer        m_cliServer;
};
}<commit_msg>Update g_dfs_server.h<commit_after>/************************************************************************************
**  
* @copyright (c) 2013-2100, ChengDu Duyer Technology Co., LTD. All Right Reserved.
*
*************************************************************************************/
/**
* @file     g_dfs_server.h
* @version     
* @brief      
* @author   duye
* @date     2014-09-24
* @note 
*
*  1. 2014-09-24 duye Created this file
* 
*/
#pragma once

#include <g_system.h>
#include <g_common.h>
#include <g_utils.h>

static const std::string DEF_DFS_CFG_FILE_PATH("./dfs_cfg.xml");

namespace gdfs {

/**
 * @brief dfs server
 */
class DfsServer : public gcom::HostServer
{
public:
    DfsServer();
    explicit DfsServer(const std::string& dfs_cfg_file_path);
    ~DfsServer();
    
    /**
     * @brief startup service
     * @return G_YES/G_NO
     * @note inherit from base class gcom::HostServer
     */       
    GResult start() = 0;
	
    /**
     * @brief stop service
     * @return G_YES/G_NO
     * @note inherit from base class gcom::HostServer
     */
    GResult stop() = 0;
	
private:	
    /**
     * @brief message loop handle
     * @return G_YES/G_NO
     * @note inherit from base class gcom::HostServer
     */
    GResult routine() = 0;     
    
    // read DFS Server configuration file
    GResult loadCfg();
    
    // create service thread
    GResult createService();
    
private:
    std::string             m_dfsCfgFilePath;
    gcom::CfgMgr            m_cfgMgr;
    gcom::NetworkServer*    m_httpServer;
    gcom::NetworkServer*    m_ftpServer;
    gcom::NetworkServer*    m_cliServer;
};
}
{'fraction_non_alphanumeric': 0.21082879612825167, 'fraction_numerical': 0.01603145795523291, 'mean_word_length': 2.895170789163722, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3004771', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1055, 'n_words': 245}