93class CLASS_DECL_ACME particle :
94 virtual public signal_handler::base
99 mutable ::platform::application * m_papplication;
100 mutable ::particle_pointer m_pparticleSynchronization;
104 particle() : m_papplication(
nullptr), m_pparticleSynchronization(
nullptr) { }
119 particle(const ::particle & particle) :
127 particle(::particle&& particle) :
143 ~particle()
override;
147 inline bool is_null()
const { return ::is_null(
this); }
148 inline bool is_set()
const {
return !is_null() && _is_set(); }
150 inline bool is_ok()
const {
return is_set() && _is_ok(); }
151 inline bool nok()
const {
return !is_ok(); }
155 void initialize(::particle * pparticle)
override;
156 void _initialize_particle(::particle* pparticle);
157 virtual void _on_initialize_app_consumer();
161 bool _is_ok()
const override;
164 virtual bool should_run()
const;
167 virtual void on_notify(::particle * pparticle, enum_id eid);
169 virtual bool on_command_final(const ::atom &
atom, ::user::activation_token * puseractivationtoken);
173 virtual bool check_pipe_node_client_executable_paths(const ::file::path & pathNode, const ::file::path & pathClient);
175 inline ::particle * trace_this()
const {
return (::particle *)
this; }
177 virtual enum_trace_level main_trace_level()
const;
179 inline bool is_debug_trace_level()
const {
return this->main_trace_level() >= e_trace_level_debug;}
181 virtual ::particle * get_context_particle();
183 inline ::particle * synchronization()
const { return ::is_set(
this) ? m_pparticleSynchronization.m_p :
nullptr; }
184 void set_synchronization(::particle * pparticleSynchronization);
185 void defer_create_synchronization();
198 virtual void on_initialize_particle();
201 virtual ::topic_pointer create_topic(const ::atom &
atom);
202 virtual ::extended_topic_pointer create_extended_topic(const ::atom &
atom);
206 static class ::platform::platform *
platform();
216 ::image::image_context* image()
const;
217 ::image::imaging * imaging()
const;
218 ::draw2d::draw2d * draw2d()
const;
219 ::write_text::write_text * write_text()
const;
222 class ::user::user *
user()
const;
233 void delete_this()
override;
241 ::internet::internet * internet()
const;
252 ::directory_system * directory_system()
const;
254 ::file_system * file_system()
const;
255 ::path_system * path_system()
const;
261 ::pointer < ::file::item > file_item(const ::file::path & path);
264 ::networking::networking * networking()
const;
270 virtual ::factory::factory_pointer & factory()
const;
271 virtual ::factory::factory_pointer & factory(const ::scoped_string & scopedstrLibrary)
const;
272 virtual ::factory::factory_pointer & factory(const ::scoped_string & scopedstrComponent, const ::scoped_string & scopedstrImplementation)
const;
273 virtual ::factory::factory * component_factory(const ::scoped_string & scopedstrComponent)
const;
283 virtual void install_message_routing(::channel * pchannel);
291 virtual ::payload get_result_payload();
298 virtual void set_finish();
304 virtual bool is_branch_current()
const;
309 virtual const_char_pointer topic_text()
const;
338 virtual enum_trace_category trace_category(const ::particle * pparticle)
const;
339 virtual enum_trace_category trace_category()
const;
371 virtual ::platform::tracer * tracer()
const;
374 virtual ::trace_statement trace_statement()
const;
377 virtual ::trace_statement & trace_statement_prefix(::trace_statement & statement)
const;
380 virtual ::trace_statement log_statement()
const;
385 virtual ::trace_statement debug()
const;
386 virtual ::trace_statement information()
const;
387 virtual ::trace_statement warning()
const;
388 virtual ::trace_statement error()
const;
389 virtual ::trace_statement fatal()
const;
392 virtual void tracef(enum_trace_level etracelevel, const_char_pointer pszFormat, ...)
const;
394 virtual void formatf_trace(enum_trace_level etracelevel, const_char_pointer pszFormat, va_list & arguments)
const;
397 template<
typename... Args>
398 void print_line(std::format_string<Args...> fmt, Args&&... args)
const
403 str.format(fmt, ::std::forward < Args >(args)...);
410 template<
typename... Args>
411 void err_line(std::format_string<Args...> fmt, Args&&... args)
const
416 str.format(fmt, ::std::forward < Args >(args)...);
422 virtual void print_line(const ::scoped_string & scopedstr)
const;
423 virtual void print_out(const ::scoped_string & scopedstr)
const;
424 virtual void printf_line(const_char_pointer pszFormat, ...)
const;
425 virtual void printf_out(const_char_pointer pszFormat, ...)
const;
426 virtual void err_line(const ::scoped_string & scopedstr)
const;
427 virtual void err_out(const ::scoped_string & scopedstr)
const;
428 virtual void errf_line(const_char_pointer pszFormat, ...)
const;
429 virtual void errf_out(const_char_pointer pszFormat, ...)
const;
431 virtual void debugf(const_char_pointer pszFormat, ...)
const;
432 virtual void informationf(const_char_pointer pszFormat, ...)
const;
433 virtual void warningf(const_char_pointer pszFormat, ...)
const;
434 virtual void errorf(const_char_pointer pszFormat, ...)
const;
435 virtual void fatalf(const_char_pointer pszFormat, ...)
const;
441 template<
typename... Args>
442 void trace(enum_trace_level etracelevel, std::format_string<Args...> fmt, Args&&... args)
const
445 auto statement = ::transfer(log_statement());
447 statement(etracelevel)(trace_category());
454 template<
typename... Args>
455 void debug(std::format_string<Args...> fmt, Args &&...args)
const
457 trace(e_trace_level_debug, fmt, ::std::forward<Args>(args)...);
459 template<
typename... Args>
460 void information(std::format_string<Args...> fmt, Args&&... args)
const
462 trace(e_trace_level_information, fmt, ::std::forward<Args>(args)...);
465 template<
typename... Args>
466 void warning(std::format_string<Args...> fmt, Args&&... args)
const
468 trace(e_trace_level_warning, fmt, ::std::forward<Args>(args)...);
471 template<
typename... Args>
472 void error(std::format_string<Args...> fmt, Args&&... args)
const
474 trace(e_trace_level_error, fmt, ::std::forward<Args>(args)...);
477 template<
typename... Args>
478 void fatal(std::format_string<Args...> fmt, Args&&... args)
const
480 trace(e_trace_level_fatal, fmt, ::std::forward<Args>(args)...);
487 void trace(enum_trace_level etracelevel, const ::scoped_string & scopedstr)
const;
488 void debug(
const scoped_string & scopedstr)
const;
489 void information(
const scoped_string & scopedstr)
const;
490 void warning(
const scoped_string & scopedstr)
const;
491 void error(
const scoped_string & scopedstr)
const;
492 void fatal(
const scoped_string & scopedstr)
const;
520 virtual void handle(const ::call & call);
521 virtual void handle_message(::message::message * pmessage);
522 virtual void handle_item(
::item * pitem);
524 using subparticle::call;
528 virtual void call_handle_message(::message::message* pmessage);
529 virtual void call_handle_item(
::item* pitem);
531 virtual bool _handle_uri(const ::scoped_string & scopedstrUri);
532 virtual bool _handle_call(
::payload &
payload, const ::scoped_string & scopedstrObject, const ::scoped_string & scopedstrMember,
::property_set & propertyset);
541 virtual void call_member(::i64 hi);
546 virtual ::lresult call_message(const ::user::enum_message & emessage,
::wparam wparam = {},
::lparam lparam = {}, ::particle * pparticle =
nullptr);
552 virtual ::payload realize();
559 virtual void set_generic_object_name(const ::scoped_string & scopedstrName);
560 virtual void set_library_name(const ::scoped_string & scopedstrLibraryName);
562 virtual void set_application_id(const ::scoped_string & scopedstrApplicationId);
574 virtual ::particle * get_taskpool_container();
577 virtual ::task_pool * taskpool();
581 virtual const_char_pointer debug_note()
const;
585 [[nodiscard]]
virtual bool should_run_async()
const;
588 virtual ::pointer<::user_interface::message_box>
589 message_box(const ::scoped_string &scopedstrMessage, const ::scoped_string &scopedstrTitle =
nullptr,
590 const ::user::e_message_box &emessagebox = {}, const ::scoped_string &scopedstrDetails =
nullptr,
591 const ::string_array_base * pstraIconUrl =
nullptr);
592 virtual ::pointer<::user_interface::message_box>
593 message_box(const ::exception &exception, const ::scoped_string &scopedstrMessage =
nullptr,
594 const ::scoped_string &scopedstrTitle =
nullptr, const ::user::e_message_box &emessagebox = {},
595 const ::scoped_string &scopedstrDetails =
nullptr, const ::string_array_base * pstraIconUrl =
nullptr);
624 virtual ::file_pointer get_file(const ::payload& payloadFile, ::file::e_open eopen, ::pointer < ::file::exception > * pfileexception =
nullptr);
629 template <
typename BASE_TYPE >
634 template <
typename TYPE >
635 inline ::pointer<TYPE> __call__create_new();
637 template <
typename TYPE >
638 inline ::pointer<TYPE> __call__create_new_clone(TYPE * p);
640 template <
typename T,
typename ...Args >
641 ::pointer < T > __call__allocate_and_initialize(Args &&... args)
646 ::std::forward<Args>(args)...));
650 return ::transfer(p);
655 template <
typename TYPE >
656 inline TYPE*__initialize(TYPE * p)
663 template <
typename TYPE >
664 inline ::pointer < TYPE > __initialize(::pointer < TYPE > && p)
666 p.m_p->initialize(
this);
667 return ::transfer(p);
671 template <
typename T >
672 ::pointer < T > create_clone(const ::pointer < T > & psource)
675 return this->create_clone(psource.m_p REFERENCING_DEBUGGING_COMMA_P_FUNCTION_NOTE(psource.m_p, __FUNCTION__, __FILE_LINE__));
681 template <
typename T >
685 auto p = this->createø< T >();
712 template <
typename T >
716 auto p = this->create_newø< T >();
732 virtual void app_post(const ::procedure & procedure);
733 virtual ::task_pointer app_fork(const ::procedure & procedure);
735 virtual void task_post(const ::procedure & procedure);
736 virtual ::task_pointer task_fork(const ::procedure & procedure);
739 virtual void user_send(const ::procedure & procedure);
745 virtual void user_post(const ::procedure & procedure);
751 virtual void main_send(const ::procedure & procedure);
757 virtual void main_post(const ::procedure & procedure);
763 virtual class ::time get_default_run_timeout();
766 virtual void send(const ::procedure & procedure);
771 virtual void post(const ::procedure & procedure);
780 virtual void handle(
bool bSynchronously, const ::procedure & procedure);
784 virtual void dispatch_procedure(enum_dispatch edispatch,
const procedure & procedure);
820 template <
typename BASE_TYPE >
821 inline bool __call__defer_construct(::pointer<BASE_TYPE>& ptype,
::factory::factory * pfactory =
nullptr);
823 template <
typename TYPE >
824 inline bool __calldefer_construct_newø(::pointer<TYPE>& ptype);
826 template <
typename TYPE >
827 inline bool __call__defer_raw_construct_new(::pointer<TYPE>& ptype);
829 template <
typename BASE_TYPE >
830 inline void __call__construct(::pointer<BASE_TYPE>& ptype,
::factory::factory * pfactory =
nullptr);
840 template <
typename BASE_TYPE >
841 inline void __call__construct_by_type(::pointer<BASE_TYPE>& ptype, const ::platform::type & type,
::factory::factory * pfactory =
nullptr);
843 virtual ::pointer<::particle> __call__create_by_type(const ::platform::type & type,
::factory::factory *pfactory =
nullptr);
845 virtual ::pointer<::particle> __call__create_by_custom_id(const ::type_custom_id & typecustomid,
::factory::factory* pfactory =
nullptr);
847 virtual ::pointer<::particle> __call__create_by_ipair(const ::type_iptr_pair & ipair,
::factory::factory* pfactory =
nullptr);
854 template <
typename TYPE >
855 inline void __call__construct_new(::pointer<TYPE>& ptype);
860 template <
typename TYPE >
861 inline void __call__raw_construct(::pointer<TYPE> & p,
::factory::factory * pfactory =
nullptr COMMA_REFERENCING_DEBUGGING_PARAMETERS_DECLARATION);
866 template <
typename T,
typename ...Args >
867 inline void __call__emplace_new(::pointer < T > &p, Args &&... args)
870 p = ::transfer(allocateø T(::std::forward<Args>(args)...));
873 template <
typename T,
typename ...Args >
874 inline void __call__emplace_new(::auto_pointer < T > &p, Args &&... args)
877 p =
new T(::std::forward<Args>(args)...);
881 template <
typename BASE_TYPE >
882 inline ::pointer<BASE_TYPE> __raw_create(::factory::factory * pfactory =
nullptr);
885#if REFERENCING_DEBUGGING
888 ::particle * __call__add_referer2(const ::reference_referer & referer)
const;
894 virtual void * new_object(const_char_pointer psz);
897 virtual string as_string()
const;
921 virtual void kick_idle();
923 particle & operator = (
const particle & particle)
936 virtual ::user::user * user();
943 virtual void process_owned_procedure_list(::procedure_list_base & procedurelist,
bool & bHandled);
946 virtual memory_file_pointer create_memory_file();
949 virtual memory_file_pointer create_memory_file(::memory_base& memory);
952 virtual memory_file_pointer create_memory_file(const ::block& block);
955 virtual memory_file_pointer create_memory_file_as_copy(
const memory& memory);
958 virtual memory_file_pointer create_memory_file_by_reading(::file::file* pfile);
968 virtual void assert_particle_ok()
const;