Giter Site home page Giter Site logo

tishion / potto Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 7.0 479 KB

A minimum cross-platform implementation of COM (Component Object Model), DI/IOC framework

Home Page: https://tishion.github.io/potto/

License: MIT License

C++ 86.05% CMake 8.63% C 3.18% Shell 1.33% Batchfile 0.81%
component-object-model inversion-of-control dependency-injection-container

potto's Introduction

potto's People

Contributors

iahung3 avatar tishion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

potto's Issues

More advanced examples

That could showcase the full power of Potto. A list of real-world projects that are using Potto is awesome, too.

Potto vs XPCOM

XPCOM as it current form in the Firefox source tree is too integrated with Firefox to be able to be used standalone. VirtualBox has their own fork of XPCOM included as part of VirtualBox source code and VirtualBox is indeed using XPCOM on non-Windows platforms. I just had a quick look at VirtualBox's XPCOM. It's so complex!

Fake COM to real COM

What do you think about modifying Potto in a way that any valid Potto object is also a valid real MS COM object? This way, the same dll could be served as both Potto COM server and MS COM server. Is it something possible?

Support GCC compiler on Windows

These results were on MSYS2 (UCRT64):

$ cmake ..
-- Building for: Ninja
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/ucrt64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/ucrt64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (2.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/msys64/home/Administrator/potto/build
$ ninja -j1
[1/12] Building CXX object CMakeFiles/potto.dir/src/PottoModuleEntryManager.cpp.obj
[2/12] Building CXX object CMakeFiles/potto.dir/src/PottoModulePoolManager.cpp.obj
[3/12] Building CXX object CMakeFiles/potto.dir/src/potto.cpp.obj
[4/12] Linking CXX shared library libpotto.dll
[5/12] Building CXX object tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
FAILED: tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
C:\msys64\ucrt64\bin\c++.exe  -IC:/msys64/home/Administrator/potto/include -IC:/msys64/home/Administrator/potto/thirdparty -std=gnu++11 -g -MD -MT tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -MF tools\CMakeFiles\pt-gen.dir\potto-gen\potto-gen.cpp.obj.d -o tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -c C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp: In function 'void GenerateClassIdHeaderFile(const std::string&, const std::string&, const std::string&)':
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:114:59: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(ghc::filesystem::path&, const std::ios_base::openmode&)'
  114 |     std::ofstream ofs(outputFilePath, std::ios_base::trunc);
      |                                                           ^
In file included from C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:32:
C:/msys64/ucrt64/include/c++/13.2.0/fstream:857:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(std::basic_ofstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  857 |       basic_ofstream(basic_ofstream&& __rhs)
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:857:7: note:   candidate expects 1 argument, 2 provided
C:/msys64/ucrt64/include/c++/13.2.0/fstream:832:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const std::string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::ios_base::openmode]'
  832 |       basic_ofstream(const std::string& __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:832:41: note:   no known conversion for argument 1 from 'ghc::filesystem::path' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
  832 |       basic_ofstream(const std::string& __s,
      |                      ~~~~~~~~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:814:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  814 |       basic_ofstream(const wchar_t* __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:814:37: note:   no known conversion for argument 1 from 'ghc::filesystem::path' to 'const wchar_t*'
  814 |       basic_ofstream(const wchar_t* __s,
      |                      ~~~~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:797:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  797 |       basic_ofstream(const char* __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:797:34: note:   no known conversion for argument 1 from 'ghc::filesystem::path' to 'const char*'
  797 |       basic_ofstream(const char* __s,
      |                      ~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:786:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]'
  786 |       basic_ofstream(): __ostream_type(), _M_filebuf()
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:786:7: note:   candidate expects 0 arguments, 2 provided
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp: In function 'void GenerateModuleLibXmlFile(const std::string&, const std::string&)':
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:205:59: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(ghc::filesystem::path&, const std::ios_base::openmode&)'
  205 |     std::ofstream ofs(outputFilePath, std::ios_base::trunc);
      |                                                           ^
C:/msys64/ucrt64/include/c++/13.2.0/fstream:857:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(std::basic_ofstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  857 |       basic_ofstream(basic_ofstream&& __rhs)
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:857:7: note:   candidate expects 1 argument, 2 provided
C:/msys64/ucrt64/include/c++/13.2.0/fstream:832:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const std::string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::ios_base::openmode]'
  832 |       basic_ofstream(const std::string& __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:832:41: note:   no known conversion for argument 1 from 'ghc::filesystem::path' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
  832 |       basic_ofstream(const std::string& __s,
      |                      ~~~~~~~~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:814:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  814 |       basic_ofstream(const wchar_t* __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:814:37: note:   no known conversion for argument 1 from 'ghc::filesystem::path' to 'const wchar_t*'
  814 |       basic_ofstream(const wchar_t* __s,
      |                      ~~~~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:797:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  797 |       basic_ofstream(const char* __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:797:34: note:   no known conversion for argument 1 from 'ghc::filesystem::path' to 'const char*'
  797 |       basic_ofstream(const char* __s,
      |                      ~~~~~~~~~~~~^~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:786:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]'
  786 |       basic_ofstream(): __ostream_type(), _M_filebuf()
      |       ^~~~~~~~~~~~~~
C:/msys64/ucrt64/include/c++/13.2.0/fstream:786:7: note:   candidate expects 0 arguments, 2 provided
ninja: build stopped: subcommand failed.

Support Clang (not Clang-Cl) compiler on Windows

These results were on MSYS2 (CLANG64):

$ cmake ..
-- Building for: Ninja
-- The C compiler identification is Clang 16.0.5
-- The CXX compiler identification is Clang 16.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/clang64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/clang64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/msys64/home/Administrator/potto/build
$ ninja -j1
[1/12] Building CXX object CMakeFiles/potto.dir/src/PottoModuleEntryManager.cpp.obj
[2/12] Building CXX object CMakeFiles/potto.dir/src/PottoModulePoolManager.cpp.obj
[3/12] Building CXX object CMakeFiles/potto.dir/src/potto.cpp.obj
[4/12] Linking CXX shared library libpotto.dll
[5/12] Building CXX object tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
FAILED: tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj
C:\msys64\clang64\bin\c++.exe  -IC:/msys64/home/Administrator/potto/include -IC:/msys64/home/Administrator/potto/thirdparty -std=gnu++11 -g -MD -MT tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -MF tools\CMakeFiles\pt-gen.dir\potto-gen\potto-gen.cpp.obj.d -o tools/CMakeFiles/pt-gen.dir/potto-gen/potto-gen.cpp.obj -c C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:114:19: error: no matching constructor for initialization of 'std::ofstream' (aka 'basic_ofstream<char>')
    std::ofstream ofs(outputFilePath, std::ios_base::trunc);
                  ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/c++/v1/fstream:1365:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const char *' for 1st argument
    explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
             ^
C:/msys64/clang64/include/c++/v1/fstream:1368:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const wchar_t *' for 1st argument
    explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);
             ^
C:/msys64/clang64/include/c++/v1/fstream:1371:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const string' (aka 'const basic_string<char>') for 1st argument
    explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
             ^
C:/msys64/clang64/include/c++/v1/fstream:1380:5: note: candidate constructor not viable: requires single argument '__rhs', but 2 arguments were provided
    basic_ofstream(basic_ofstream&& __rhs);
    ^
C:/msys64/clang64/include/c++/v1/iosfwd:141:32: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
    class _LIBCPP_TEMPLATE_VIS basic_ofstream;
                               ^
C:/msys64/clang64/include/c++/v1/fstream:1363:5: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
    basic_ofstream();
    ^
C:/msys64/home/Administrator/potto/tools/potto-gen/potto-gen.cpp:205:19: error: no matching constructor for initialization of 'std::ofstream' (aka 'basic_ofstream<char>')
    std::ofstream ofs(outputFilePath, std::ios_base::trunc);
                  ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/c++/v1/fstream:1365:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const char *' for 1st argument
    explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
             ^
C:/msys64/clang64/include/c++/v1/fstream:1368:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const wchar_t *' for 1st argument
    explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out);
             ^
C:/msys64/clang64/include/c++/v1/fstream:1371:14: note: candidate constructor not viable: no known conversion from 'ghc::filesystem::path' to 'const string' (aka 'const basic_string<char>') for 1st argument
    explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
             ^
C:/msys64/clang64/include/c++/v1/fstream:1380:5: note: candidate constructor not viable: requires single argument '__rhs', but 2 arguments were provided
    basic_ofstream(basic_ofstream&& __rhs);
    ^
C:/msys64/clang64/include/c++/v1/iosfwd:141:32: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
    class _LIBCPP_TEMPLATE_VIS basic_ofstream;
                               ^
C:/msys64/clang64/include/c++/v1/fstream:1363:5: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
    basic_ofstream();
    ^
2 errors generated.
ninja: build stopped: subcommand failed.

Note: this issue is about MinGW based Clang, not MSVC based Clang.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.