Minimum Platform Requirements

來源:互聯網
上載者:User

 

Code
/**********************************************************************************************

    Class        :    e_Platform
    Description    :    encapsulated all platform related functions for portability.
    Comments    :    
    History        :    

**********************************************************************************************/

class e_Platform {
public:
    //    Modules:
    static e_ModuleHandle    load_module( string name );
    static void                free_module( e_ModuleHandle module );
    static e_SymbolHandle    get_symbol( e_ModuleHandle module, const string name );

    //    Threads:
    static uint                get_number_threads();
    static e_ThreadHandle    create_thread( e_ThreadFunction func, pvoid param );
    static int                wait_thread( e_ThreadHandle thread );
    static void                wait_multiple_threads( int num_threads, e_ThreadHandle threads[] );
    static int                delete_thread( e_ThreadHandle thread );
    static void                create_mutex( e_Mutex & mutex );
    static void                delete_mutex( e_Mutex & mutex );
    static void                lock_mutex( e_Mutex & mutex );
    static void                unlock_mutex( e_Mutex & mutex );

    //    Time:
    static float            get_time();

    //    Environment:
    static string            get_environment( const string name );

    //    Files and Directories:
    static int                file_exists( string name );
    static void                format_filename( string & name );
    static e_FileHandle        open_file( string name, const e_FileMode mode );
    static uint                read_file( e_FileHandle file, pvoid buf, const uint size );
    static uint                write_file( e_FileHandle file, const pvoid buf, const uint size );
    static void                close_file( e_FileHandle file );
    static void                delete_file( string name );
    static string            get_temp_filename( string dir, const string prefix );
    static void                create_directory( string name );
    static void                delete_directory( string name );
    static void                enumerate( string name, e_FileEnumerator func, pvoid param );
    static string            get_current_directory();

    //    Memory:
    static pvoid            alloc( size_t size );
    static void                dealloc( pvoid ptr );
    static pvoid            aligned_alloc( size_t size, size_t align );
    static void                aligned_dealloc( pvoid ptr );
};

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.