diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2009-11-12 18:46:23 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2009-11-12 18:46:23 -0800 |
commit | 4b29fe640ae852c04d5d87d0f9527bdc32177ad1 (patch) | |
tree | 310b38e74c5942a86975af4bcb32d3adab9b6e88 /nexus/PropertyManager.h | |
parent | 85b3fcc5de004999756c1e90bcf845480217b3f6 (diff) | |
download | system_core-4b29fe640ae852c04d5d87d0f9527bdc32177ad1.tar.gz system_core-4b29fe640ae852c04d5d87d0f9527bdc32177ad1.tar.bz2 system_core-4b29fe640ae852c04d5d87d0f9527bdc32177ad1.zip |
eclair snapshot
Diffstat (limited to 'nexus/PropertyManager.h')
-rw-r--r-- | nexus/PropertyManager.h | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/nexus/PropertyManager.h b/nexus/PropertyManager.h index 10d0b2aa9..af56a9c15 100644 --- a/nexus/PropertyManager.h +++ b/nexus/PropertyManager.h @@ -22,36 +22,28 @@ #include <utils/List.h> -#include "IPropertyProvider.h" - -class PropertyPair { -private: - char *mName; - IPropertyProvider *mPp; - -public: - PropertyPair(const char *name, IPropertyProvider *pp); - virtual ~PropertyPair(); - - const char *getName() { return mName; } - IPropertyProvider *getProvider() { return mPp; } -}; - -typedef android::List<PropertyPair *> PropertyPairCollection; +#include "Property.h" class PropertyManager { - PropertyPairCollection *mPropertyPairs; - pthread_mutex_t mLock; + PropertyNamespaceCollection *mNamespaces; + pthread_mutex_t mLock; public: PropertyManager(); - virtual ~PropertyManager(); - int registerProperty(const char *name, IPropertyProvider *pp); - int unregisterProperty(const char *name); - android::List<char *> *createPropertyList(); + virtual ~PropertyManager(); + int attachProperty(const char *ns, Property *p); + int detachProperty(const char *ns, Property *p); + + android::List<char *> *createPropertyList(const char *prefix); int set(const char *name, const char *value); const char *get(const char *name, char *buffer, size_t max); + +private: + PropertyNamespace *lookupNamespace_UNLOCKED(const char *ns); + Property *lookupProperty_UNLOCKED(PropertyNamespace *ns, const char *name); + int doSet(Property *p, int idx, const char *value); + int doGet(Property *p, int idx, char *buffer, size_t max); }; #endif |