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

#include <g_system.h>

namespace gcom {
    
/**
 * @brief server statue
 */
typedef enum 
{
    HOST_SERVER_INIT = 0,
    HOST_SERVER_WORK,
    HOST_SERVER_STOP,
    HOST_SERVER_FAULT
} HostServerState;
  
/**
 * @brief host server base class
 */
class HostServer : public gsys::ThreadTask
{
public:
    HostServer() : m_serverState(HOST_SERVER_INIT) {}
    virtual ~HostServer() {}
    
    /**
     * @brief startup service
     * @return G_YES/G_NO
     */       
    virtual GResult start() = 0;
	
    /**
     * @brief stop service
     * @return G_YES/G_NO
     */
    virtual GResult stop() = 0;
	
    /**
     * @brief message loop handle
     * @return G_YES/G_NO
     */
    virtual GResult routine() = 0;       
	
    /**
     * @brief set/get host server state	
     */
    void setServerState(const HostServerState& state) { m_serverState = state; }
    const HostServerState& getServerState() const { return m_serverState; }
    
private:
    // inherit from base class gsys::ThreadTask
    // to run new service thread
    GResult run() { return routine(); }	
	
private: 
    HostServerState     m_serverState;	 
};
}<commit_msg>Update g_host_server.h<commit_after>/************************************************************************************
**  
* @copyright (c) 2013-2100, ChengDu Duyer Technology Co., LTD. All Right Reserved.
*
*************************************************************************************/
/**
* @file     g_host_server.h
* @version     
* @brief      
* @author   duye
* @date     2014-10-09
* @note 
*
*  1. 2014-10-09 duye Created this file
* 
*/
#pragma once

#include <g_system.h>

namespace gcom {
    
/**
 * @brief server statue
 */
typedef enum 
{
    G_HSERVER_INIT = 0,
    G_HSERVER_WORK,
    G_HSERVER_STOP,
    G_HSERVER_FAULT
} HostServerState;
  
/**
 * @brief host server base class
 */
class HostServer : public gsys::ThreadTask
{
public:
    HostServer() : m_serverState(HOST_SERVER_INIT) {}
    virtual ~HostServer() {}
    
    /**
     * @brief startup service
     * @return G_YES/G_NO
     */       
    virtual GResult start() = 0;
	
    /**
     * @brief stop service
     * @return G_YES/G_NO
     */
    virtual GResult stop() = 0;
	
    /**
     * @brief message loop handle
     * @return G_YES/G_NO
     */
    virtual GResult routine() = 0;       
	
    /**
     * @brief set/get host server state	
     */
    void setState(const HostServerState& state) { m_state = state; }
    const HostServerState& state() const { return m_state; }
    
private:
    // inherit from base class gsys::ThreadTask
    // to run new service thread
    GResult run() { return routine(); }	
	
private: 
    HostServerState     m_state;	 
};
}
{'fraction_non_alphanumeric': 0.21473750790638838, 'fraction_numerical': 0.018342820999367487, 'mean_word_length': 2.690781796966161, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1778246', 'n_tokens_mistral': 1050, 'n_tokens_neox': 964, 'n_words': 243}