The following commit has been merged in the master branch:
commit 568552ae83e4e8625059a1cbca3a536fb8d7cbb6
Author: andrei zavada <[email protected]>
Date:   Fri Sep 28 18:08:22 2012 +0300

    reorder CSubject fields for clarity & suchlike

diff --git a/src/expdesign/primaries.cc b/src/expdesign/primaries.cc
index f3f2a58..47a24eb 100644
--- a/src/expdesign/primaries.cc
+++ b/src/expdesign/primaries.cc
@@ -338,13 +338,13 @@ gender_sign( TGender g)
 agh::CSubject::
 CSubject (const string& dir,
          sid_type id)
-  : _status (0),
+  : full_name (""),
+    gender (TGender::neuter),
+    age (21),
+    _status (0),
     _id (id),
     _dir (dir),
-    _name (dir.substr( dir.rfind('/')+1)),
-    full_name (_name),
-    gender (TGender::neuter),
-    age (21)
+    _name (dir.substr( dir.rfind('/')+1))
 {
        ifstream ifs (_dir + "/.subject_info");
        char gender_char;
@@ -354,6 +354,8 @@ CSubject (const string& dir,
              getline( ifs, comment, '\n'),
              ifs.good()) )
                gender = (TGender)gender_char;
+       else
+               full_name = _name;
 }
 
 
diff --git a/src/expdesign/primaries.hh b/src/expdesign/primaries.hh
index 683380d..5abbc74 100644
--- a/src/expdesign/primaries.hh
+++ b/src/expdesign/primaries.hh
@@ -45,9 +45,8 @@ typedef size_t sid_type;
 
 class CSubject {
 
-    friend class CExpDesign;
-
        void operator=( const CSubject&) = delete;
+       CSubject () = delete;
 
     public:
        enum class TGender : char {
@@ -55,16 +54,6 @@ class CSubject {
        };
        static const char* gender_sign( TGender g);
 
-    private:
-       CSubject() = delete;
-
-       int     _status;
-
-       sid_type
-               _id; // eventually to allow distinctly identifiable namesakes 
in different groups
-
-       string  _dir,
-               _name;
     public:
        string  full_name;
        TGender gender;
@@ -250,6 +239,14 @@ class CSubject {
                {
                        return _id == id;
                }
+
+    private:
+       int     _status;
+       sid_type
+               _id; // eventually to allow distinctly identifiable namesakes 
in different groups
+
+       string  _dir,
+               _name;
 };
 
 
@@ -340,18 +337,16 @@ class CExpDesign {
                {
                        map<string, CJGroup>::const_iterator G;
                        const CSubject& J = subject_by_x(j, &G);
-                       return _session_dir + '/' + G->first + '/' + J._name;
+                       return _session_dir + '/' + G->first + '/' + J.name();
                }
 
       // scan tree: build all structures
-       // void (*)(const char* fname_being_processed,
-       //               size_t total_sources_found,
-       //               size_t now_processing)
        static TMsmtCollectProgressIndicatorFun progress_fun_stdout;
        void scan_tree( TMsmtCollectProgressIndicatorFun progress_fun = 
progress_fun_stdout);
+    private:
        void compute_profiles();
-       void sync();
 
+    public:
       // edf sources
        int register_intree_source( sigfile::CSource &&F,
                                    const char **reason_if_failed_p = nullptr);
@@ -365,6 +360,8 @@ class CExpDesign {
        void remove_untried_modruns();
        void export_all_modruns( const string& fname) const;
 
+       void sync();
+
       // global info on expdesign
        list<string> enumerate_groups() const;
        list<string> enumerate_subjects() const;
@@ -403,7 +400,7 @@ class CExpDesign {
        ach::STunableSet<ach::TTRole::d>        tstep;
        ach::STunableSet<ach::TTRole::l>        tlo;
        ach::STunableSet<ach::TTRole::u>        thi;
-       ach::STunableSetWithState       tunables0;
+       ach::STunableSetWithState               tunables0;
 
        ach::SControlParamSet
                ctl_params0;

-- 
Sleep experiment manager

_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to