Apache Celix  latest
Apache Celix is a framework for C, C++14 and C++17 to develop dynamic modular software applications using component and in-process service-oriented programming.
Public Member Functions | Protected Attributes | Friends | List of all members
celix::dm::BaseComponent Class Reference

#include <Component.h>

Inheritance diagram for celix::dm::BaseComponent:
Inheritance graph
[legend]

Public Member Functions

 BaseComponent (celix_bundle_context_t *con, celix_dependency_manager_t *cdm, std::string name, std::string uuid)
 
virtual ~BaseComponent () noexcept
 
 BaseComponent (const BaseComponent &)=delete
 
BaseComponentoperator= (const BaseComponent &)=delete
 
celix_dm_component_t * cComponent () const
 
celix_bundle_context_t * bundleContext () const
 
const std::string & getUUID () const
 
const std::string & getName () const
 
ComponentState getState () const
 
void wait () const
 
void runBuild ()
 

Protected Attributes

celix_bundle_context_t * context
 
celix_dependency_manager_t * cDepMan
 
celix_dm_component_t * cCmp
 
std::string cmpUUID {}
 
std::string cmpName {}
 
std::atomic< bool > cmpAddedToDepMan {false}
 
std::mutex mutex {}
 
std::vector< std::shared_ptr< BaseServiceDependency > > dependencies {}
 
std::vector< std::shared_ptr< BaseProvidedService > > providedServices {}
 
std::vector< std::shared_ptr< void > > componentContexts {}
 

Friends

std::ostream & operator<< (std::ostream &out, const BaseComponent &cmp)
 

Constructor & Destructor Documentation

◆ BaseComponent() [1/2]

celix::dm::BaseComponent::BaseComponent ( celix_bundle_context_t *  con,
celix_dependency_manager_t *  cdm,
std::string  name,
std::string  uuid 
)
inline

◆ ~BaseComponent()

BaseComponent::~BaseComponent ( )
inlinevirtualdefaultnoexcept

◆ BaseComponent() [2/2]

celix::dm::BaseComponent::BaseComponent ( const BaseComponent )
delete

Member Function Documentation

◆ bundleContext()

celix_bundle_context_t* celix::dm::BaseComponent::bundleContext ( ) const
inline

Returns the C bundle context

◆ cComponent()

celix_dm_component_t* celix::dm::BaseComponent::cComponent ( ) const
inline

Returns the C DM Component

◆ getName()

const std::string& celix::dm::BaseComponent::getName ( ) const
inline

Returns the cmp name.

◆ getState()

ComponentState celix::dm::BaseComponent::getState ( ) const
inline

Return the cmp state

◆ getUUID()

const std::string& celix::dm::BaseComponent::getUUID ( ) const
inline

Returns the cmp uuid.

◆ operator=()

BaseComponent& celix::dm::BaseComponent::operator= ( const BaseComponent )
delete

◆ runBuild()

void BaseComponent::runBuild ( )
inline

Run the dm component build. After this call the component is added to the dependency manager and is enabled. The underlining service registration and service tracker will be registered/created async.

◆ wait()

void BaseComponent::wait ( ) const
inline

Wait for an empty Celix event queue.

Should not be called on the Celix event queue thread. Note scheduled events are not part of the event queue.

Can be used to ensure that all created/updated components are completely processed (services registered and/or service trackers are created).

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const BaseComponent cmp 
)
friend

Stream outputs the full component info.

Member Data Documentation

◆ cCmp

celix_dm_component_t* celix::dm::BaseComponent::cCmp
protected

◆ cDepMan

celix_dependency_manager_t* celix::dm::BaseComponent::cDepMan
protected

◆ cmpAddedToDepMan

std::atomic<bool> celix::dm::BaseComponent::cmpAddedToDepMan {false}
protected

◆ cmpName

std::string celix::dm::BaseComponent::cmpName {}
protected

◆ cmpUUID

std::string celix::dm::BaseComponent::cmpUUID {}
protected

◆ componentContexts

std::vector<std::shared_ptr<void> > celix::dm::BaseComponent::componentContexts {}
protected

◆ context

celix_bundle_context_t* celix::dm::BaseComponent::context
protected

◆ dependencies

std::vector<std::shared_ptr<BaseServiceDependency> > celix::dm::BaseComponent::dependencies {}
protected

◆ mutex

std::mutex celix::dm::BaseComponent::mutex {}
protected

◆ providedServices

std::vector<std::shared_ptr<BaseProvidedService> > celix::dm::BaseComponent::providedServices {}
protected

The documentation for this class was generated from the following files: