User Tools

Site Tools


libnum:classes:gear

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
libnum:classes:gear [2026/03/28 11:48] abclibnum:classes:gear [2026/03/29 13:53] (current) abc
Line 118: Line 118:
  
 ===== Gear Output ===== ===== Gear Output =====
-The Output is implemented via //GearEngineCallback// interface. The most GearEngine data are available via //GearEngineContext// object, passed to its method ''call(const GearEngineContext& contex)''.+The Output is implemented via //GearEngineCallback// interface. The most GearEngine data are available via //GearEngineContext// object, passed to its method ''call(const GearEngineContext& context)''.
  
 The //libnum// library includes the following two classes for general useage: //GearPrintToStream// and //GearPrintTable//. Both interfaces use user-declared output stream for their target (see [[https://en.cppreference.com/w/cpp/io/basic_ostream.html|STL manual]]). It can be: The //libnum// library includes the following two classes for general useage: //GearPrintToStream// and //GearPrintTable//. Both interfaces use user-declared output stream for their target (see [[https://en.cppreference.com/w/cpp/io/basic_ostream.html|STL manual]]). It can be:
Line 131: Line 131:
   {   {
   public:   public:
-    GearPrintToStream(std::ostream& target, const char* format = "{} "); // double value format string+    GearPrintToStream(std::ostream& target, const char* format = "{} ");
     virtual bool call(const GearEngineContext&) override;     virtual bool call(const GearEngineContext&) override;
-    void setFormat(const char* format);  // std::format syntax supposed, e.g. "{:8.5f}\t"+    void setFormat(const char* format);
   };   };
  
-  class GearPrintTable : public GearEngineCallback+  class GearPrintTable : public GearPrintToStream
   {   {
   public:   public:
-    GearPrintTable(double output_step);+    GearPrintTable(std::ostream& target, double output_step, const char* format = "{} ");
     virtual bool call(const GearEngineContext&) override;     virtual bool call(const GearEngineContext&) override;
     void reset();     void reset();
-  private: 
-    static const double NOT_SET; 
-    double output_step; 
-    double nextPoint; 
   };   };
  
  
 ---- ----
-[ [[.:|Libnum classes]] ] [ [[..:examples:gear|Example of usage]] ]+[ [[.:|Libnum classes]] ] [ [[..:examples:gear|Examples of usage]] ]
  
libnum/classes/gear.1774687734.txt.gz · Last modified: by abc