Search code examples
c++xpcom

Do I need to create an interface for every self-created class I use in XPCOM?


I'm a noob to XPCOM development. In the course of writing XPCOM code in C++, I need to create addtional classes for use inside my XPCOM component. Do I need to create another XPCOM component for such classes? Can't I just add the new class in the header file?


Solution

  • No, not at all. XPCOM describes the external interface. "Internal" classes are compiled by your C++ compiler. That compiler won't snitch on you, so XPCOM will never know they exist.

    For your own sanity, it does make sense to keep those internal classes in their own header.